I am trying to run this query, but i repeatedly get an error message. Any suggestions?
SELECT DD_INTERVAL, VENDOR_ID, COUNTRY, "SUM"(VOLUME) as Volume, "SUM"(COST) as Cost
FROM Table_1
WHERE VENDOR_ID ='35',
DD_INTERVAL = '7',
COUNTRY = ('idn','lao','mys','phl','sgp','tha','vnm')
GROUP BY DD_INTERVAL, Vendor_ID, COUNTRY;
From what I know about SQL your query should look like this
SELECT DD_INTERVAL, VENDOR_ID, COUNTRY, SUM(VOLUME) as Volume, SUM(COST) as Cost
FROM Table_1
WHERE VENDOR_ID ='35'
AND DD_INTERVAL = '7'
AND COUNTRY IN ('idn','lao','mys','phl','sgp','tha','vnm')
GROUP BY DD_INTERVAL, Vendor_ID, COUNTRY;
Quotes should not be around the SUM
You need a AND
or OR
between each where clause depending the result your looking for.
COUNTRY =
should be
COUNTRY IN