Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

POSTGRES IF statement fails

By: a guest on Feb 21st, 2012  |  syntax: None  |  size: 0.24 KB  |  views: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ERROR:  syntax error at or near "status" at character 11
  2. LINE 1: SELECT IF status = 'L' THEN edate ELSEIF status = 'C' THEN '...
  3.        
  4. SELECT
  5.   CASE status
  6.     WHEN 'L' THEN edate
  7.     WHEN 'C' THEN 'wrong date'
  8.   END as date
  9. FROM
  10.   campaigns;
clone this paste RAW Paste Data