RE: Why doesn't this query work?

2003-06-01 Thread Nick Arnett
> -Original Message-
> From: Mikey [mailto:[EMAIL PROTECTED]
> Sent: Friday, May 30, 2003 11:53 AM
> To: [EMAIL PROTECTED]
> Subject: Why doesn't this query work?
>
>
> OK, first of all thanks for the pointers, however, the query I now have
> doesn't seem to work.  If I run the query up until "pricelevel IN
> (1, 2, 3,
> 4, 5)" it returns a large result set (the clauses are fairly inclusive),
> however, when I add in the rest of the query no results are returned.  Any
> ideas?

This is just a guess, but perhaps you are comparing INTs to STRINGs with
that last bit, in which case you'd want to change the column type for
pricelevel or put quotes around the numbers in the query?  I hit that
problem all the time using 1 and 0 as Booleans in an ENUM column.

Nick


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Why doesn't this query work?

2003-05-31 Thread Mikey
>  You might try some partial queries before the big one to see if there are
> reasonable results -
>
> select count(*) , list.prodcode
>   from application as app, application_list as list
>  where app.id=list.appl_id
>AND app.name IN (7, 23, 16, 9, 18, 24, 25, 5, 13, 11, 10, 6,
> 20, 14, 19,
> 22,
> 3, 17, 4, 8, 21, 2, 27, 15, 1, 26, 12)
>  group by list.prodcode
>  order by list.prodcode

I have run this query and it returns absolutely nothing

> select count(*) , list.prodcode
>   from msoft_codes as prod, application_list as list
>  WHERE prod.parentcolour IN ('BLACK', 'ORANGES',
> 'OLIVES-LINCOLN', 'GREYS',
> 'DARK REDS','GREEN-BROWNS', 'DARK BLUES', 'LAVENDERS/LILACS', 'BROWNS',
> 'BLUES','MAUVES', 'CORN/GOLDS', 'BLUE-GREENS', 'MID-PINKS',
> 'NEUTRALS', 'PALE
> BLUES & GREENS', 'MID-REDS', 'IVORY', 'GREENS', 'PALE PINKS & PEACHES',
> 'WHITE')
>AND pricelevel IN (1, 2, 3, 4, 5)
>AND prod.prodcode=list.prodcode
>  group by list.prodcode
>  order by list.prodcode

However, this query returns 1677 results... any ideas?  I really need to get
this query working ASAP so any help is greatly appreciated :)

Mikey


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]