select ytd_sales as sales,--表中ytd_sales的值,显示名称为sales
au_fname+' '+au_lname as author,--au_fname字段加一空格加au_lname 字段连成一串显示名称 为author
toauthor=(ytd_sales*royalty)/100,--ytd_sales字段 乘 royalty字段 后面的结果 显示名称为 toauthor
topublisher=ytd_sales-(ytd_sales*royalty)/100 同上
au_fname+' '+au_lname as author,--au_fname字段加一空格加au_lname 字段连成一串显示名称 为author
toauthor=(ytd_sales*royalty)/100,--ytd_sales字段 乘 royalty字段 后面的结果 显示名称为 toauthor
topublisher=ytd_sales-(ytd_sales*royalty)/100 同上
au_fname+' '+au_lname as author,
toauthor=(ytd_sales*royalty)/100,
topublisher=ytd_sales-(ytd_sales*royalty)/100
from TableName
ytd_sales,au_fname,au_lname,ytd_sales,royalty 都是数据库里面的字段名字
取出ytd_sales这一列的值 另命名为sales,au_fname 和 au_lname 加起来 中间加上空格
相当于把人的first name 和 last name 连在一起 中间 用空格隔开 作为author 列,
ytd_sales 乘以royalty 再除以100 作为 toauthor,
ytd_sales减去 (ytd_sales*royalty)/100 作为topublisher
author和toauthor是别名,在这里主要是显示名称,还可以作用查询的引用名称
au_fname ==> author_first_name
au_lname ==> author_last_name
toauthor ==> 销售收入分成中归作者的部分
topublisher ==> 销售收入分成中归出版社的部分
谢谢