[SQL] Related table question
Ruslan Zasukhin
sunshine at public.kherson.ua
Thu Jan 15 21:42:52 CST 2004
on 1/15/04 9:20 PM, Eric Forget at forgete at cafederic.com wrote:
>> Table A { a1 }
>>
>> 1
>> 2
>> 3
>>
>>
>> Table B { ptr ,b1 }
>>
>> 1 1
>> 1 2
>> 1 3
>> 2 1
>> 2 2
>>
>> Now when I do
>>
>> select *
>> from a, B
>> WHERE a.recID *= b.ptr
>> and b.b1 <> 1
>>
>>
>> I get
>>
>> a ptr b1
>> 1 1 2
>> 1 1 3
>> 2 2 2
>> 3 null null
>>
>>
>> So query works right.
>
> But this is not what I need. I need something like:
>
> select A.RecID
> from A, B
> WHERE A.recID *= b.ptr
> and B.b1 <> 1
>
> Then I get
>
> RecID
> 1 1
> 1 1
> 2 2
> 3 3
^^^^^^^^^^^^^^ why 2 columns if you SELECT A.RecID only.
> Which is not what I want!
Btw, please show what you WANT to get from above 2 tables?
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list