关于SQL语句的问题 两个表合在一起,谢谢 15
selectdate=convert(varchar(50),date,23),pdctnoasmodel,qtyasquantity,cslxastypefromqaa...
select date=convert(varchar(50),date,23),pdctno as model,qty as quantity,cslx as type from qaafcgcsbselect convert(varchar(50),indate,23) as date,project as type,line as model,count(line) as quantity from pro_phl_set where project like '%蚀刻因子%' or project like '%深镀能力%' group by line,indate,project order by count(line) asc
展开
2017-05-04
展开全部
(select date=convert(varchar(50),date,23),pdctno as model,qty as quantity,cslx as type from qaafcgcsb group by line,date,project
union
select convert(varchar(50),indate,23) as date,line as model,count(line) as quantity,project as type from pro_phl_set where project like '%蚀刻因子%' or project like '%深镀能力%' group by line,indate,project)
order by count(line) asc
追问
消息 207,级别 16,状态 1,第 9 行
列名 'line' 无效。
消息 104,级别 16,状态 1,第 9 行
如果该语句包含 UNION、INTERSECT 或 EXCEPT 运算符,则 ORDER BY 项必须出现在选择列表中。
不行啊老铁
消息 207,级别 16,状态 1,第 9 行
列名 'line' 无效。
消息 104,级别 16,状态 1,第 9 行
如果该语句包含 UNION、INTERSECT 或 EXCEPT 运算符,则 ORDER BY 项必须出现在选择列表中。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询