Tuesday, 15 July 2014

sql - How do I return a partcular string if column value is null MySQL -



sql - How do I return a partcular string if column value is null MySQL -

how homecoming particular string if column value null mysql? in instance below values "tablea.name" null user has forgot fill it.

in case rather returning null, i'd sort of if statement check if value null "name not assigned"

my mysql query:

select `shoes_item`.product_name, `run_task`.name, `shoes_item`.notes `shoes_item` test left outer bring together `run_item` on `run_item`.shoes_id = `shoes_item`.shoes_id left outer bring together `run_details` on `run_details`.run_item_id = `run_item`.run_item_id

is looking for?

select ifnull(shoes_item.product_name,"name not assigned") product_name, run_task.name, shoes_item.notes shoes_item test left outer bring together run_item on run_item.shoes_id = shoes_item.shoes_id left outer bring together run_details on run_details.run_item_id = run_item.run_item_id

mysql sql database

No comments:

Post a Comment