-
Need help with IF FUnction in MYSQL
Hi,
Please help me with the below query,
I know something is wrong with the query
select name, model, year, price, A.standard, A.optional, A.notes from ABC
WHERE standard <> NULL
AND (IF Standard= NULL THEN Optional) OR (IF Optional =NULL THEN notes)
order by name, model , year DESC
THANK YOU
-
Hello
I hope that the 2 queries below will help you to find your expected query.
SELECT name, model, year, price, standard, optional, notes
FROM ABC
WHERE IFNULL(standard, IFNULL(optional, notes))
ORDER BY name, model, year DESC
SELECT name, model, year, price, standard, optional, notes, IFNULL(standard, IFNULL(optional, notes)) AS sta_opt_not
FROM ABC
ORDER BY name, model, year DESC
Greetings
ld_be
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|