create proc storeproc @c varchar(20)
select * from (
select a as aa,b as bb from tablea where a=@c
union
select c as aa,cc as bb from tableb where c=@c
) order by aa
union 的两个表字段的数据类型都一样的
是要建个存储过程,@c是传入参数
这样用好像不行啊,可我必须union后在排序,而且必须有参数
错误:order by 附近由于法错误
select * from (
select a as aa,b as bb from tablea where a=@c
union
select c as aa,cc as bb from tableb where c=@c
) order by aa
union 的两个表字段的数据类型都一样的
是要建个存储过程,@c是传入参数
这样用好像不行啊,可我必须union后在排序,而且必须有参数
错误:order by 附近由于法错误
解决方案 »
- 急急急急急急急急急急急急急急急急!!!导出excel问题
- BLL(DAL)层生成异常,如会话过期,这样的异常如何处理?高分的简单问题!
- datalist里如何得到当前item的索引值
- 如何编程实现access数据导入sql server
- asp.net怎么实现TextBox内容改变立即触发事件(特殊情况)
- 怎么好像没有什么人去研究websharp 这个例子的
- ASP.NET运行时错误.给定编码中的字符无效
- event.clientX和event.clientY到底是什么意思?
- linq如何对递归数据进行投影?
- 谁有像发邮件附件的源代码!急!积极
- 请问怎样获得TEXTAREA被选中部分的内容啊?up的有分
- 關于第二書店分頁技術....
@c varchar(20)
as
select a as aa,b as bb from tablea where a=@c
union all
select c as aa,cc as bb from tableb where c=@c
order by aa
as
select * from (
select a as aa,b as bb from tablea where a=@c
union
select c as aa,cc as bb from tableb where c=@c
) order by aa
少了个as
as (
select a as aa,b as bb from tablea where a=@c
union
select c as aa,cc as bb from tableb where c=@c
) order by aa