June 19, 2024 at 7:26 pm
select Colum1 , Colum2 from table 1
Union All
select Colum1 , Colum2 from table 2
Union All
select Colum1 , Colum2 from table 3
How to Optimize above 3 Queries into one.
June 19, 2024 at 7:34 pm
Combining them wouldn't optimize it. For three different tables, SQL must still scan each table/covering index to provide the results.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 20, 2024 at 2:27 pm
I am looking for With out Union all how to achieve same Query o/p. Any helps highly Appreciated.
June 20, 2024 at 2:32 pm
.
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy