cancel
Showing results for 
Search instead for 
Did you mean: 

When have EXCEPT and INTERSECT been introduced?

09-22-2010 5:41 PM
VolkerBarth Contributor
5337 views 4 comments Go to solution
SAP Managed Tags
Subscribe

While I'm about to leave ASA 8.0.3 behind, I made some comparisons with ASA 8.0.3.5574 and SA 12.0.0.2566 and accidently used EXCEPT and INTERSECT on ASA 8.0.3.

I had strongly expected a syntax error as I was absolutely sure both set operators were introduced with ASA9 (and they are not at all documented with ASA 8), but they work.

Just couldn't believe it: Have I deliberately - but unfounded! - left out these handy operators all those years when working with ASA 8 (while using them on newer version)?

Or have I missed a relevant piece of information?


But wait and calm down, Volker - they seem to get accepted syntactically in ASA 8.0.3 but don't seem to work correctly, i.e. a

SELECT pk_Column FROM table1 EXCEPT SELECT pk_Column FROM table2

does return the same resultset as without the EXCEPT clause or with an INTERSECT clause.

So it seems I have not missed an important feature...

My pulse is still accelerating...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

In version 8, EXCEPT would not have been recognized as a keyword. In your example, it would have been treated as an identifier, specifically an alias for table1. The line:

SELECT pk_Column FROM table1 EXCEPT SELECT pk_Column FROM table2

would have been treated as a Transact-SQL batch returning two results sets. If you execute it in DBISQLC and then enter "resume", you'll see the second result set.

VolkerBarth
Contributor
0 Likes

Ah, I see - I had not thought of the T-SQL batch feature but that makes it very reasonable that my sample statement worked whereas more complex ones (i.e. use this statement as a derived table) gives a syntax error. - Well, better SQL dialects use statement delimiters, don't they:)

Answers (1)

Answers (1)

VolkerBarth
Contributor
0 Likes

Just to complete and answer the title question (whereas Bruce has answered the real question😞

As already stated in my question - both set operators were introduced with ASA 9.0.