SELECT 'id' FROM `table` WHERE `id` =
(select min(`id`) FROM `table` where
`id` < 1 and `ids` = 1)
id ids
1 1
2 1
5 1
6 1
Result:
id = ''
I need to change id='' to id='n/a'
SELECT 'id' FROM `table` WHERE `id` =
(select min(`id`) FROM `table` where
`id` < 1 and `ids` = 1)
id ids
1 1
2 1
5 1
6 1
Result:
id = ''
I need to change id='' to id='n/a'
Copyright © 2021 Jogjafile Inc.
If the query return a null result you can use COALESCE so :
OR if the return result is an empty string you can do :