top子句用于规定要返回的记录的数目(并非所有数据库系统都支持top子句)

sql top与like(二)

选取头两条记录:select top 2 * from Persons

选取50%的记录:select top 50 percent from Persons

like 操作符 用于在where 子句中搜索列中的指定模式。

提示:"%" 可用于定义通配符(模式中缺少的字母)。

sql top与like(二)

从Persons表中选取居住在以"g"结尾的城市里的人:

select * from persons where City like '%g'


从Persons 表中选取居住在不包含“lon”的城市里的人(使用NOT关键字):

select * from Persons where city not like '%lon%';

相关文章:

  • 2022-02-23
  • 2022-01-11
  • 2022-02-14
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2021-07-18
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
相关资源
相似解决方案