Query giving unexpected results.
Bill Numerick
bnumerick at gmail.com
Fri Sep 10 12:26:58 CDT 2004
Thanks for the reply Ruslan.
Ok I changed the query like you suggested and its returning even more
results than before. It looks like its not taking the
optional_feature.of_type = 'Exteriors' . Here's the full query with
the from this time ;).
SELECT optional_feature.id,
optional_feature.name,model_optional_feature.msrp,model_optional_feature.parent_id
FROM model, optional_feature, model_optional_feature WHERE (model.id
= model_optional_feature.model_id AND
model_optional_feature.optional_feature_id = optional_feature.id) AND
(model.id = '59' AND optional_feature.of_type = 'Exteriors' AND NOT
optional_feature.id in (16,17,18,20,21,56,99,163,203,204,242) ) ORDER
BY optional_feature.name ASC
So are you saying 2 isn't as picky? :).
On Fri, 10 Sep 2004 19:10:28 +0300, Ruslan Zasukhin
<sunshine at public.kherson.ua> wrote:
> On 9/10/04 6:28 PM, "Bill Numerick" <bnumerick at gmail.com> wrote:
>
> Hi Bill,
>
> > I am using the query below to return a set of results from a data.
> >
> > SELECT * WHERE model.id = '37' AND model.id =
> > model_optional_feature.model_id AND optional_feature.id not in
> > (16,17,18,20,21,56,99,163,203,204,242) AND
> > model_optional_feature.optional_feature_id = optional_feature.id AND
> > optional_feature.of_type = 'Exteriors' ORDER BY optional_feature.name
> > ASC
>
> Try such edition:
>
> SELECT *
>
> <<<<< where is FROM clause ??????
>
> WHERE
> (model.id = model_optional_feature.model_id
> AND model_optional_feature.optional_feature_id = optional_feature.id)
> AND
> (model.id = '37'
> AND optional_feature.of_type = 'Exteriors'
> AND NOT optional_feature.id in (16,17,18,20,21,56,99,163,203,204,242) )
>
> ORDER BY
> optional_feature.name ASC
>
> > and it does not seem to exclude optional_feature.id not in
> > (16,17,18,20,21,56,99,163,203,204,242) from the list.
>
> > I got this query is coming from the website that uses a mySql database and it
> > works perfect there.
>
> > I've tried doing individual optional_feature.id
> > <>16 AND ... through all of the id's but that gets the same results.
>
> > Any work around? There are quite a few queries like this so i'm
> > trying to make it so i don't have to go back and rewrite all of them,
> > sql support was the main reason we choose to use Valentina in the
> > first place from V-12 and if i have to rewrite everything it kind of
> > defeats the purpose.
>
> Not worry, just Valentina 1.x is a little sensitive to order of conditions.
>
> --
> 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
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
More information about the Valentina
mailing list