I have column location but i need to return this column based on value of another column below is the MYSQL SELECT QUERY:
if(block.block_id IS NOT NULL)
{
location.location = 'BLOCKED'
}elseif(nvocc.nvocc_id is not null AND nvocc.nvocc_status = 'IN') {
location.location = 'NVOCC'
}else {
location.location = location.location
}
i treid with case conditon but its showing error
CASE
WHEN block.block_id IS NOT NULL THEN "BLOCKED"
WHEN ((nvocc.nvocc_id IS NOT NULL) AND (nvocc.nvocc_status='IN')) THEN "NVOCC"
ELSE location.location
END as location
the above query returns nothing and not working please someone help me to solve this issue.
SELECT, not withCASE. It is entirely unclear what code you are actually running.