Where Clause in Parenthesis
Darren Reely
darren.reely at latticesemi.com
Wed Aug 17 13:03:28 CDT 2005
Joe Boyle wrote:
> first of all I would suggest that you place the 'where' clause in brackets
> as below.
> where ( (im.credit_note_flag = 'Y' ) and &
> (id.gl_account_no <> 'D2480' ) )
Joe,
Is that one of those 'Old School' practices again. Based on the WHERE
clause above, parenthesis seem to simply be a setup for possible
confusion with no added value.
I suppose the reason to add extra parenthesis could be due to knowledge
of a particular database engine. Years ago when I worked with the
Digital RDB database, via Pascal, we had an expert tell us that
parenthesis helped the RDB engine make more efficient queries. And sure
enough, we saw some performance gains by carefully rearranging our
statements within grouped parenthesis.
Darren
More information about the powerh-l
mailing list