code_junkie

Oracle: What does `(+)` do in a WHERE clause?

Nov 13th, 2011
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. SELECT
  2. Table1.Category1,
  3. Table1.Category2,
  4. count(*) as Total,
  5. count(Tab2.Stat) AS Stat
  6. FROM Table1, Table2
  7. WHERE (Table1.PrimaryKey = Table2.ForeignKey(+))
  8. GROUP BY Table1.Category1, Table1.Category2
  9.  
  10. SELECT
  11. Table1.Category1,
  12. Table1.Category2,
  13. COUNT(*) AS Total,
  14. COUNT(Table2.Stat) AS Stat
  15. FROM Table1
  16. LEFT OUTER JOIN Table2 ON (Table1.PrimaryKey = Table2.ForeignKey)
  17. GROUP BY Table1.Category1, Table1.Category2;
Add Comment
Please, Sign In to add comment