select * from (select id,username,password from table where <condition>) a,(select count(*) as num from table where <condition>)好像是这样写的,如果你用的是MYSQL的话,可能会有改动,MYSQL的功能很弱的.