Login
Register
All Activity
Questions
Unanswered
Tags
Users
Ask a Question
About Us
986
Questions
785
Answers
Interview Preparation mode
beta
Funny Facebook Status
Enter your email address
All categories
SQL Server Interview Questions and Answers
(197)
SSIS Interview Questions and Answers
(54)
SSRS Interview Questions and Answers
(9)
SSAS Interview Questions and Answers
(29)
.NET Interview Questions and Answers
(186)
Oracle Interview Questions and Answers
(122)
Java Interview Questions and Answers
(32)
UNIX Interview Questions and Answers
(47)
Networking Interview Questions and Answers
(17)
MySQL Interview Questions and Answers
(30)
HR Interview Questions and Answers
(237)
General Interview Questions and Answers
(9)
Other Interview Questions and Answers
(8)
Job Openings
(3)
Greenplum Database Interview Questions and Answers
(5)
Can you explain the difference between the INTERSECT and EXCEPT operators?
Nice?
Vote!
asked
1 year
ago
in
SQL Server Interview Questions and Answers
by
Anand
(
1,440
points)
sql-server-interview-question
t-sql
operator
2 Answers
Nice?
Vote!
INTERSECT returns data value common to BOTH queries (queries on the left and right side of the operand). On the other hand, EXCEPT returns the distinct data value from the left query (query on left side of the operand) which does not exist in the right query (query on the right side of the operand).
Example:
Table 1 has values: sql, ssis, ssas
Table 2 has values: ssrs, java, sql
Except query:
SELECT COL1 FROM Tbl_1 EXCEPT SELECT COL1 FROM tbl_2
GO
This will return ssis, ssas, ssrs, java
answered
1 year
ago
by
Anand
(
1,440
points)
Nice?
Vote!
EXCEPT: Two query expressions are evaluated and the difference between the results will be returned by EXCEPT operator. The result set will have rows returned from the first set of rows except the rows those are also returned from the second set of rows.
INTERSECT: The result of two queries is evaluated and returns the rows which are common to each.
answered
1 year
ago
by
Anand
(
1,440
points)
Related questions
Nice?
Vote!
5
answers
What is the difference between DDL and DML commands? Can you name some examples of each?
asked
1 year
ago
in
SQL Server Interview Questions and Answers
by
R
(
19,530
points)
sql-server-interview-question
junior-sql-server-developer-interview-questions
t-sql
Nice?
Vote!
1
answer
What is the difference between “HAVING” and “WHERE” clause, in MS SQL Server?
asked
1 year
ago
in
SQL Server Interview Questions and Answers
by
R
(
19,530
points)
sql-server-interview-question
t-sql
Nice?
Vote!
Add
Ans!
What is the difference between “UNION” and “UNION ALL”, in MS SQL Server?
asked
1 year
ago
in
SQL Server Interview Questions and Answers
by
R
(
19,530
points)
sql-server-interview-question
t-sql
Nice?
Vote!
Add
Ans!
Can you explain Fifth Normal Form?
asked
1 year
ago
in
SQL Server Interview Questions and Answers
by
Ruban
(
360
points)
sql-server-interview-question
database
t-sql
Nice?
Vote!
Add
Ans!
Can you explain Fourth Normal Form?
asked
1 year
ago
in
SQL Server Interview Questions and Answers
by
Ruban
(
360
points)
sql-server-interview-question
t-sql
database