Re: Can conditions be mixed with DISTINCT()

2005-10-25 Thread Dobromir Velev
Hi, I think you could use something like SELECT DISTINCT (CASE p.ship_status WHEN '1' THEN "shipping_now" WHEN '2' THEN "shipping_soon" ELSE 'unknow' END) as status FROM products AS p INNER JOIN cart AS i ON i.product_id = p.id WHERE i.session_id = " & prepSQL(tConn, tSessionID); If there a

Can conditions be mixed with DISTINCT()

2005-10-24 Thread Scott Haneda
tSql = "SELECT DISTINCT(p.ship_status) FROM products AS p INNER JOIN cart AS i ON i.product_id = p.id WHERE i.session_id = " & prepSQL(tConn, tSessionID); p.ship_status is either a "1" or a "0", which is just how the database was set up ages, ago. I am moving thes