duanjue9889 2014-03-26 14:27
浏览 30
已采纳

如何从表A中显示5列,然后从表B中显示2列,然后在SQL Server连接中再次显示表A中的剩余coulmns

How to show 5 columns from TABLE A, then 2 columns from Table B, then remaining coulmns from Table A again in a sql server join .

Follwing is my query.

SELECT DISTINCT A.*, B.local_time, B.creation_time FROM #SqlData A INNER JOIN @OracleInfo B ON A.event_id = B.GLOBALEVENTID

this order is specifically required to keep the similar columns together. And both the tables have really large number of columns. so i don't want to name them directly.

Please help me out.

  • 写回答

2条回答 默认 最新

  • dsztc99732 2014-03-26 14:31
    关注
     SELECT DISTINCT A.COL1,A.COL2,A.COL3,A.COL4,A.COL5, B.local_time, B.creation_time, A.COL6, A.COL7, A.COLN FROM #SqlData A INNER JOIN @OracleInfo B ON A.event_id = B.GLOBALEVENTID
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?