select * from store where name like 'my%'

解决方案 »

  1.   

    select * from store 
    where name like 'my%' 
      

  2.   

    1 表名 最好不要用 store, 列名也不要用 name
    2 先看书,再干事
      

  3.   

    %和_都是数据库里的通配符,%是替代任意长度的任意字符,_是替代一个任意字符,
    例如表A里又记录:
    col1   col2
    123    asd
    12     asdf
    134    asdfasdf
    那么:
    select * from table where name like "1%"
    结果:
    col1   col2
    123    asd
    12     asdf
    134    asdfasdfselect * from table where name like "1_"
    结果:
    col1   col2
    12     asdfselect * from table where name like "1__"
    结果:
    col1   col2
    123    asd
    134    asdfasdf
      

  4.   

    写错了一点,是select * from A where ………… (不是select * from table where ……)
      

  5.   

    ft,脑子怎么了,还是写错了,是
    select * from A where col1 like "1%"
    结果:
    col1  col2
    123    asd
    12     asdf
    134    asdfasdfselect * from A where col1 like "1_"
    结果:
    col1  col2
    12    asdfselect * from A where col1 like "1__"
    结果:
    col1  col2
    123    asd
    134    asdfasdf
      

  6.   

    一般的数据库的书都会有关于sql的部分,先了解一下大概,再深入,不要急,通常的sql语句很容易的。
      

  7.   

    是什么数据库啊?sql server建议就看bol吧.结合论坛提问,绝对能解决问题.
    我就是这么蒙混过关的.
      

  8.   

    select * from store where name like 'my%' 
      

  9.   

    select * from store where name like 'my%'