1

I want to return all columns, and anywhere there's a NULL to say 'hey' instead.

But this doesn't work

SELECT IFNULL(*, 'hey') FROM $table
Adel Khayata
  • 2,717
  • 10
  • 28
  • 46
Lan
  • 1,874
  • 2
  • 20
  • 37
  • **What does "doesn't work" mean?** "Doesn't work" is an inadequate description for us to understand the problem. What happened when you tried it? Did you get incorrect results? Did you get *no* results? If the results were incorrect, what made them incorrect? What were you expecting instead? Did you get *any* correct results? If so, what were they? Don't make us guess. – Andy Lester Aug 17 '13 at 23:34
  • 1
    In this case the syntax used is obviously invalid, so one can infer the error message. – Jim Garrison Aug 18 '13 at 00:22

1 Answers1

4

You have to do this one column at a time.

Functions do not generally take * as an argument.

select ifnull(col1, 'hey'), . . .
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786