Re: SQL meaning

  • From: "Jared Still" <jkstill@xxxxxxxxx>
  • To: amonte <ax.mount@xxxxxxxxx>
  • Date: Tue, 28 Oct 2008 11:01:58 -0700

Well, you might consider:

http://www.amazon.com/Art-SQL-Stephane-Faroult/dp/0596008945

http://www.amazon.com/Cookbook-Cookbooks-OReilly-Anthony-Molinar

http://www.amazon.com/SQL-Tuning-Dan-Tow/dp/0596005733

http://www.amazon.com/SQL-Pocket-Guide-References/dp/0596526881

I'm not real familiar with these books, but am familiar with the authors,
all of which are quite capable.

Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist



On Tue, Oct 28, 2008 at 10:18 AM, amonte <ax.mount@xxxxxxxxx> wrote:

> hmmm it returned different results
>
> omg, I need to get some sql courses because this query looks too advanced
> for me :-(
>
> know any good sql books?
>
>
> Alex
>
>
>
> On Tue, Oct 28, 2008 at 5:29 PM, Jared Still <jkstill@xxxxxxxxx> wrote:
>
>> On Tue, Oct 28, 2008 at 8:48 AM, amonte <ax.mount@xxxxxxxxx> wrote:
>>
>>> So the query cannot be wriiten as follows?
>>> SELECT   userobj.ID, NAME, summary
>>>     FROM userobj
>>>    WHERE userobj.NAME LIKE 'A%'
>>>      *AND attr1 IN ('#ID#TOP')*
>>>      AND userobj.ID IN (
>>>             SELECT ID
>>>               FROM userattr
>>>              WHERE ( attr1 IN (
>>>                           SELECT ID
>>>                             FROM orgattr
>>>                            WHERE orgattr.attrname =
>>> 'CONTAINEDBYOBJECTGROUP'
>>>                              AND attrval IN ('#ID#TOP'))
>>>                    ))
>>> ORDER BY userobj.ID
>>>
>>>
>> Whether or not that works is dependent on the data.
>>
>> The original query included "where attr1 IN ('#ID#TOP') OR ...".
>>
>> The modified query cannot return the same results unless all
>> occurrences of "attrval = '#ID#TOP'" also have
>> "attrname = 'CONTAINEDBYOBJECTGROUP'"
>>
>> You really need to know the data, and whether or not that condition is
>> enforced
>> if it exists.
>>
>> Have you tried running the query?
>>
>> Jared
>>
>>
>>
>

Other related posts: