例如:
一张表:  name   age
  leo    24
  tom    29
  jerry  24如何用一句SQL 查询出age为24的记录。谢谢各位

解决方案 »

  1.   

    select * from 表 where age=24
      

  2.   

    select * from tablename where age=24
      

  3.   

    select * from table_name where age='24'
      

  4.   

    age  只是我的例子实际上  这个值是不 确定的  ,  只是查询相同的出来。谢谢大家,问题解决  马上给分
      

  5.   


       
       select fields(你的字段) from tablename(表名) groups 
       by  fields(你的字段) having count(*)>1
      

  6.   

    ADODataset1.CommandText:='Select * from 表名 where age=:age';
      

  7.   

    giveusomecolor(农民也扣篮(俺村我最坏~~~)) 的正解
      

  8.   

    giveusomecolor(农民也扣篮(俺村我最坏~~~)) ( ) 信誉:100  2005-07-01 09:12:00  得分: 0  
       
       select fields(你的字段) from tablename(表名) groups 
       by  fields(你的字段) having count(*)>1//==============为什么我的要报错呢select 表号 from db groups by 表号 having count(*)>1
      
     
      

  9.   

    select age,count(ag) from table group by age having count(ag)>1
      

  10.   

    select 表号 from db group by 表号 having count(*)>1后---------------------------
    Debugger Exception Notification
    ---------------------------
    Project Project1.exe raised exception class EDatabaseError with message 'ADOQuery1: Missing SQL property'. Process stopped. Use Step or Run to continue.
    ---------------------------
    OK   Help   
    ---------------------------
    为什么呀。急呀
      

  11.   

    uniqueform.ADOQuery1.Active:= true;
        uniqueform.ADOQuery1.SQL.Clear;
        uniqueform.ADOQuery1.SQL.Text:= 'select 表号 from db group by 表号 having count(*)>1';
        uniqueform.ADOQuery1.ExecSQL;
      

  12.   

    同意 giveusomecolor(农民也扣篮(俺村我最坏~~~))
      

  13.   

    'Select * from 表名1,表名2 where 表名1.age=表名2.age'