[Vserver+V4RB] Querying a table JOINed to itself
Ruslan Zasukhin
sunshine at public.kherson.ua
Mon Dec 13 19:28:55 CST 2004
On 12/13/04 5:49 PM, "Eric Ferrer" <wonderfef at noos.fr> wrote:
>
> Hello all,
>
> Maybe my db strucure is poorly designed, but ...
>
> I have a PriceLists table that contains BOTH
> PriceLists Name
> And
> Articles Prices
>
> I have also an Articles table.
>
> I'd like to query the database to search displayable PriceLists name and the
> corresponding prices
>
> Here what I'm trying to do :
>
> SELECT
> N.Name, P.Price
> FROM
> PriceLists N,
> PriceLists P
> WHERE
> N.Owners LIKE 'TV' ''this is specific to my app
> AND
> N.ParentPriceListID = '' '' to get price list name
> AND
> N.ID *= P.ParentPriceListID
> AND
> P.ParentArticleID = '123ABC'
>
> I'd need the cursor to display 0.00 if no record found for one of the price
> lists, i.e :
>
> SOME ARTICLE NAME HERE
> 2005 price: 0 (not yet stored)
> 2004 price: 200
> 2003 Price: 159
>
> But I can't make this work.
> Thanks in advance for your help.
So what is problem?
You want get 0, but what you really get ?
--
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