How to use order by with union operators in ms sql server?
Answer / Idreesh Ahmed
To use the ORDER BY clause with the UNION operator in MS SQL Server, you can combine multiple SELECT statements with UNION and place the ORDER BY at the end of the query:n`(SELECT column1, column2 FROM table1 WHERE condition1) UNION (SELECT column1, column2 FROM table2 WHERE condition2) ORDER BY column1, column2`
| Is This Answer Correct ? | 0 Yes | 0 No |
What is normalization and what are the different forms of normalizations?
Can a table have 2 primary keys?
What is normalization and its types?
Explain how to use linked server?
What is dknf in normalization form?
What is a table called, if it does not have neither Cluster nor Non-cluster Index?
what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration
What are the 3 types of schema?
How will you add a dimension to cube? : sql server analysis services, ssas
What is sql collation?
what are default? Is there a column to which a default cant be bound?
what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)