请先回答nononono(null,null)的问题, 然后说明你用的什么数据库.

解决方案 »

  1.   

    ‘第一条记录’指最早插入表的那条吗?假设有主键ID可以这样:
       
       select a.房间号,a.预定时间,a.退房时间,a.结帐金额       from table a,(select 房间号,min(id) as id from table group by 房间号) b      where a.id=b.id order by a.房间号
     
      

  2.   

    就是lj_lt的意思,最早插入的那条记录
    但现在就是没有主键ID:(
      

  3.   

    select 房間号,預定时間,退房时間,結帳金額 
    from TableName a,
    (select 房間号 homeno,min(預定时間) mintime from TableName
    group by 房間号) b
    where 房間号 = homeno and 預定时間 = mintime;
      

  4.   

    哇,zhuzhichao(竹之草)好棒:)