Moeb
Moeb

Reputation: 10871

Precedence of operators in SQL*Plus

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 -.

Upvotes: 1

Views: 534

Answers (1)

Michael Goldshteyn
Michael Goldshteyn

Reputation: 74470

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)

Upvotes: 2

Related Questions