Learn T-SQL Commands with Samples
Skip Navigation Links
Skip Navigation Links.
Expand DatabaseDatabase
Expand TableTable
Expand ViewView
Expand Stored ProcedureStored Procedure
Expand Data FilteringData Filtering
Expand Data GroupingData Grouping
Expand JoinsJoins
Expand TriggerTrigger
Expand CursorCursor
Collapse OperatorsOperators
Expand ConstraintsConstraints
Expand FunctionsFunctions
Expand Conditional ProcessingConditional Processing
Expand LoopingLooping
Expand Error HandlingError Handling
Expand v.IMP Queriesv.IMP Queries
Expand XMLXML
Expand Query PerformanceQuery Performance
Expand QueriesQueries
Expand NormalizationNormalization
Expand CreateCreate
     

Except

 
Continents
Country Continent
India Asia
USA N.America
Italy Europe
Continents1
Country Continent
Italy Europe
India Asia
Ghana Africa
      
---- Returns any distinct values from the First query that are not also found on the Second query.
SELECT * FROM Continents EXCEPT SELECT * FROM Continents1
Output
Country Continent
USA N.America
SELECT * FROM Continents1 EXCEPT SELECT * FROM Continents
Output
Country Continent
Ghana Africa