no return value from empty table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas Svenson

    #1

    no return value from empty table

    Hi list,

    I'm new here so I don't know if this has been discussed earlier.

    I have a problem with the following:
    SELECT IF(column = 'string', 'a', 'b') AS test FROM table;

    It works just fine if the table is populated. However, if the table is empty
    (which this one very well can be from time to time) I get no return value at
    all.

    Is there any way I can get MySQL to return "test = b" if the table is empty?

    /T


    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=m...ie.nctu.edu.tw

Working...