SQL - me bad or parser bad

Robert Brenstein rjb at rz.uni-potsdam.de
Wed Mar 26 12:49:36 CST 2003


>on 3/26/03 11:15 AM, Robert Brenstein at rjb at rz.uni-potsdam.de wrote:
>
>>>>   SQL query:
>>>>
>>>>   Select r_rid,r_lna,r_fna,r_mna,r_ema,r_tit,a_titl,
>>>>   a_cdts,r_fee,u_canc,u_oral From
>>>>   abstract2,registration2a,registration2b
>>>>   Where r_rid = u_rid and a_rid = u_rid and a_cdts < 1046077200 and
>>>>   r_fee <> 5  and r_fee <> 6 and u_canc = '' and u_oral = ''
>>>>   Order by r_lna,r_fna
>>>
>>>  Hi Robert,
>>>
>>>  Check that you group fields from one table together!
>>>  Most probably this is source of problem.
>>>
>>
>>  Ruslan, sounds like you missed what I wrote at the bottom:
>>
>>>  The order of "where" items is like Ruslan recommended in the past:
>>>  links first, then conditions grouped by table. I tried changing the
>>>  order, putting quotes. However, no matter what order I use, I get
>>>  records with either non-empty u_canc or non-empty u_oral whichever
>>>  is first in the Where clause!
>>
>>  I haven't tried every possible reordering, of course. These quirks of
>>  the parser seem to always get me at worst time -- like in major
>>  embarassment for me and your product. When is the real sql parser
>>  coming?
>
>Okay, then try also to add  ()  around fields.
>
>In 2.0.
>

Aha, using parenthesis around these two fields DOES work.

Robert


More information about the Valentina mailing list