Geoff Millikan
asked on
Using ROUND(x) generates ERROR 1241: Operand should contain 1 column(s)
I am getting the below error when using the below query. What do I need to change in my query? This error started taking place when I added the ROUND() function which I added so that the math would round out to two decimal places instaed of the existing four places e.g. $234.3456 and I want it to be $234.35.
ERROR 1241: Operand should contain 1 column(s)
SELECT DISTINCT account_name, COUNT(return_code), CONCAT('$',SUM(check_amoun t)), CONCAT((ROUND(SUM(check_am ount)/2345 6)*100,2), '%') AS 'Rank' FROM `bcf_collections` WHERE (locate('296',pcid)>0 OR locate('---',account_name) >0) AND pos_date BETWEEN '2005-03-06' AND '2005-04-06' GROUP BY account_name ORDER BY 'Rank'DESC ;
ERROR 1241: Operand should contain 1 column(s)
SELECT DISTINCT account_name, COUNT(return_code), CONCAT('$',SUM(check_amoun
ASKER
Well, we're getting a new error code now with the new query below-
ERROR 1064: You have an error in your SQL syntax;
SELECT DISTINCT account_name, COUNT(return_code),
CONCAT('$',SUM(check_amoun t)),
CONCAT(ROUND((SUM(check_am ount)/2345 6)*100,2), '%')) AS 'Rank'
FROM `bcf_collections` WHERE (locate('296',pcid)>0 OR locate('---',account_name) >0) AND
pos_date BETWEEN '2005-03-06' AND '2005-04-06'
GROUP BY account_name
ORDER BY 'Rank' DESC;
ERROR 1064: You have an error in your SQL syntax;
SELECT DISTINCT account_name, COUNT(return_code),
CONCAT('$',SUM(check_amoun
CONCAT(ROUND((SUM(check_am
FROM `bcf_collections` WHERE (locate('296',pcid)>0 OR locate('---',account_name)
pos_date BETWEEN '2005-03-06' AND '2005-04-06'
GROUP BY account_name
ORDER BY 'Rank' DESC;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
should be:
CONCAT(ROUND((SUM(check_am