IFNULL issues??

2001-06-19 Thread BCC
Hi, Maybe someone could take a moment to explain this behavior? I am using IFNULL() in an order by statement to push null values to the end of a table for sorting. For example: mysql select distinct s.some_pk as myid, queryid from data_table s, userdata.queryinfo q where s.some_pk=q.myid order

Re: IFNULL issues??

2001-06-19 Thread Cal Evans
If you drop the order by, does the second query work? Cal * * Cal Evans * Senior Internet Dreamer * http://www.calevans.com * - Original Message - From: BCC [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 12:18 PM Subject: IFNULL issues?? Hi, Maybe someone could

RE: IFNULL issues??

2001-06-19 Thread Bryan Coon
]] Sent: Tuesday, June 19, 2001 10:45 AM To: BCC; [EMAIL PROTECTED] Subject: Re: IFNULL issues?? If you drop the order by, does the second query work? Cal * * Cal Evans * Senior Internet Dreamer * http://www.calevans.com

Re: IFNULL issues??

2001-06-19 Thread Jonothan Farr
Message - From: BCC [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 10:18 AM Subject: IFNULL issues?? Hi, Maybe someone could take a moment to explain this behavior? I am using IFNULL() in an order by statement to push null values to the end of a table for sorting

RE: IFNULL issues??

2001-06-19 Thread Bryan Coon
I would try: select distinct s.some_pk, IFNULL(s.some_pk, 999) as myid from data_table s, other_data_table where s.some_pk=232 order by myid; Although I don't get the purpose of the IFNULL or the order by if you're selecting only a single value of s.some_pk. --jfarr The single