SQL UNION ALL - Introduction and syntax
SQL - Dec 03, 2008 at 18:00 PM by Rajmeet Ghai
Explain the SQL UNION ALL statement. Write SQL syntax for the SQL UNION ALL
statement along with an example.
SQL UNION ALL: The UNION ALL operator is used to combine the
result-set of two or more SELECT statements Tables of both the select statement
must have the same number of columns with similar data types. It lists ALL
records.
Syntax:
SELECT column_name(s) FROM table_name1 UNION ALL SELECT column_name(s)
FROM table_name2
Example:
SELECT emp_Name FROM Employees_india UNION ALL SELECT emp_Name FROM
Employees_USA
SQL Union - May 18, 2009 at 10:00 AM by
Rajmeet Ghai
What is the difference between UNION and UNION ALL?
UNION command selects distinct and related information from two
tables. On the other hand, UNION ALL selects all the values from
both the tables.
Also read
RAID is a mechanism of storing the same data in different
locations. Since the same data is stored, it is termed as
redundant............
Define
transaction and transaction isolation levels.
Answer - A transaction is a set
of operations that works as a single unit. The ransactions can be
categorized into explicit, autocommit, and implicit....
SQL Server Optimization
Tips
Answer - Restricting query
result means return of required rows instead of all rows of the
table. This helps in reducing network traffic......
Question: What is the
purpose of SQL Profiler in SQL server?
Answer - SQL Profiler captures SQL Server events
from a server. The events are saved.....
Question: What are the
ways available in SQL Server to execute SQL statements?
Answer - SQL Server uses different ways to
execute SQL statements which are listed below......
Question: What is the
significance of NULL value and why should we avoid permitting null
values?
Answer - Null means no entry has been made. It
implies that the value is either unknown or
undefined.....
|