现有table(名为student),其中一字段名为no,取值为****01**,****50**,诸如此类
倒数三四位需要提取进行比较,将其在01至20的记录取出,并显示在dbgrid中,以及生成一个新表(名为result)
怎么写这段代码?

解决方案 »

  1.   

    是sqlserver的话:
    select * from student where substring(no,5,2)=>'01' and substring(no,5,2)<='20'
      

  2.   


    select * from student where substring(no,5,2) between '01' and '20'
      

  3.   

    SELECT INTO 语句创建一个新表,并用 SELECT 的结果集填充该表。新表的结构由选择列表中表达式的特性定义:
      select * from student where substring(no,5,2) between '01' and '20' newtablename
      

  4.   

    select * from student where substring(no,5,2) between '01' and '20' 
    into result