[SQL Server] Combining Multiple Tables Having Count |
Combining Multiple Tables Having Count Posted: 21 Apr 2013 01:32 AM PDT Hello,I am trying to combine multiple tables, and then show only when value [Qry] when it is greater than 1 after combining the tables, below is what i wrote but not working.. thanks for your help in advanceselect [Dm],[Qry],[AP]from (select [DM],[Qry],[AP]from [dbo].[MyTable1]unionselect [DM], [Qry],[Ap]from [dbo].[MyTable2]unionselect [dm],[Qry],[Ap]from [dbo].[MyTable3]) as ALL_MY_Tableshaving count ([Qry])>1 |
You are subscribed to email updates from SQLServerCentral / SQL Server 2008 / SQL Server Newbies To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment