select * from (select....)

摘要:select * from (select....)


写的项目刚好,遇到要用 select * from (select....)


select * from(
select distinct[产品编号],[车台编号],[模具编号表表号], 生产数量,序号 
 FROM [dbo].[Stock模具耗损统计表] ) as temptable

--请加入 as 表单别名(temptable) 不然会显示 Incorrect syntax near ')'. 错误



个人感觉用起来temptable差不多,就像在使用暂存表单

不过还是参考比较常看到的temptable的方法吧!
http://www.dotblogs.com.tw/hellouk/archive/2010/10/07/18163.aspx
http://social.msdn.microsoft.com/Forums/zh-TW/240/thread/850f5bf2-79b5-4f32-ba40-0bba2db1e929
http://cbw0731.pixnet.net/blog/post/24993864-%E6%9A%AB%E5%AD%98%E8%A1%A8(temporary-tables)%E7%9A%84%E4%BD%BF%E7%94%A8%E7%B0%A1%E4%BB%8B

大家一起加入blogads 赚零用钱!!

原文:大专栏  select * from (select....)


猜你喜欢

转载自www.cnblogs.com/chinatrump/p/11458238.html