这句SQL语句是什么意思呀

来源:百度知道 编辑:UC知道 时间:2024/05/24 05:04:54
讲得我看懂就给分了
select top 17 a.*,b.itemName as BitemName,b.itemName as CitemName from bbs_info a join bbs_Item b on a.itemID=b.itemID where a.regState>1 order by a.regState desc,a.rvtTime desc
a.*,b.itemName as BitemName,b.itemName
bbs_info a join bbs_Item b
重点是这两句,a.*....bbs_info a

找出表bbs_info 的所有字段,表bbs_Item 的BitemName字段
符合 bbs_info.temID=bbs_Item.temID
条件 where bbs_info.regState >1
bbs_info.rvtTime 降序排列
前面17行数据

那两句就是:
找出表a(就是所谓的表 bbs_info)的所有字段,
表b(就是所谓的表 bbs_Item )的itemName 字段并重命名为 BitemName