views:

18

answers:

1

How is

A - B U B - A

parsed in SQL*Plus?

Is it parsed as

(A - B) U (B - A) or as A - (B U B) - A ?

I could find this page using Google, but it doesn't say which has higher precedence, U or -.

+2  A: 

For Oracle, all SQL set operators have equal precedence. See: http://www.nycinformatics.com/sql/sqlsetoperators.htm\ and http://download.oracle.com/docs/cd/A58617_01/server.804/a58225/ch3all.htm

So, for your question, the order is:

(((A - B) U B) - A)
Michael Goldshteyn
And left-to-right associativity?
Jonathan Leffler
That is correct...
Michael Goldshteyn