I'm not entirely sure what you're trying to do - it may help if you post more of the query. It looks like you're trying to do something like a CASE expression.
OK, you will need a CASE expression as I thought. The basic syntax would be something like:
Code:
SELECT id_no, account, balance, odlimit,
CASE
WHEN (odlimit = '00' AND balance < '00') OR (odlimit = '500' AND balance < '-500') THEN 'Y'
ELSE 'N'
END AS newcolumn
FROM tbl
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.