I have this mysql code:
SELECT firstname, lastname, age, gender from persons WHERE id = 1;
Display:
> firstname: Marlon
>
> lastname: Null
>
> age: 26
>
> gender: male
What I want to do is:
SELECT IF NULL DONT SELECT(firstname), IF NULL DONT SELECT(lastname), IF NULL DONT SELECT(age), IF NULL DONT SELECT(gender) from persons WHERE id = 1;
Display:
> firstname: Marlon
>
> age: 26
>
> gender: male
lastname didn't display because its null