首页 >> sql语句 >> 详细内容
sql语句
 
sql语句 >> 正文
在列上加入计算
日期:2017/6/15 
1、 使用去除空格函数Trim,Ltrim,Rtrim
Select 产品名称 from biao where trim(产品名称) like trim(text1.text)
2、 使用字符函数Left ,Right,Mid 
Select 产品名称 from biao where right(产品名称,3) like “电视机” 
3、 使用数字函数如abs,len等
Select 产品名称,利润 from biao where abs(利润)<20
4、 使用日期函数year , month 等
Select 产品名称 from biao where year(销售日期)=”1998”
 本列中使用的SQL语句为
Select 编号,产品名称,单价,数量, (数量*单价) as 总金额 from biao