I'm using Informix 9.3. I'm selecting one column and am trying to return two columns using the two separate COUNTs as subqeuries.
I'm trying to combine this query, which works fine by itself...
SELECT sl_store,
COUNT(sl_price) AS price
FROM informix.sales
WHERE sl_date between '05-25-2008' AND '05/31/2008' and sl_price >= '195'
GROUP BY sl_store
...with this query that also works fine by itself.
SELECT sl_store,
COUNT(ALL sl_disreason) AS discount
FROM informix.sales
WHERE sl_date between '05-25-2008' AND '05/31/2008' and sl_disreason = '09'
GROUP BY sl_store
This is the latest script I've come up with but I can't get it working.
SELECT sl_store,
FROM informix.sales
WHERE (SELECT COUNT(sl_price) AS price FROM informix.sales WHERE sl_date between '05/25/2008' AND '05/31/2008' and sl_price >= '195')
AND (SELECT COUNT(sl_disreason) AS discount FROM informix.sales WHERE sl_date between '05/25/2008' AND '05/31/2008' sl_disreason = '12')
GROUP BY sl_store