tags:

views:

175

answers:

3

What do the following mean in an sql sytax:

  1. (+) after a condition eg: "WHERE table1.col1 = table2.col2 (+)

  2. What does /* */ after select signify , i vaguely remember it being a suggestion to the optimizer, but where can i find more reference on this eg: select /* */ ...

+6  A: 
  1. The (+) means an outer join syntax for SQL on Oracle.

  2. The /* alter the SELECT means a comment. In Oracle if the comments starts with /*+ (A plus after the comment token, means a hint, for instance /*+ORDERED*/

FerranB
ah yes, those are hints. I can google for further reference. Thanks
+1  A: 

If we are talking oracle then the (+) is an outer join and /* some stuff */ is a comment. If the comment is of the form /*+ hint* */ then the comment is probably a hint. google on oracle hints

stjohnroe
The formatting stuff escapes me
stjohnroe
I tried editing to add the inline-code backticks. Does that make it do what you want?
Bill Karwin
Close, was trtying to get the rem hint in italics /*+ hint */
stjohnroe
+1  A: 

By the way, a lot of business intelligence is stealth in SQL queries - and most queries, as long as they can be, do not have comments at all !

This is a shame :o)

Adding /* */ comments in a query should be done every time the query is not obvious. That is to say, most of the time...

A+ Sylvain.

Sylvain