SQL语句中获取名字的首字母
有一个表格
Cus_Lname Cus_Fname
nnnnnnnnnnnnnnnn Alan
Brown Brenda
Chang Chi
Dewitt Dwayne
List the details of customers who's last name starts with "C".
获取last name 中首字母为C的数据。
------解决方案--------------------select *
from tb
where left(Cus_Lname,1)='C'
------解决方案--------------------select *
from tb
where Cus_Lname like 'C%'
或者
select *
from tb
where substring(Cus_Lname,1,1)='C'