Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2007
    Posts
    21

    Unanswered: Change a column value in a select query

    Hello,
    I have a column in my table called reboot and it should have a string value of either true or false but in some cases 0 or 1 have been entered. Is there some way I can change the 0 and 1 to false and true during a select statement?

    Thanks,
    tom

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    SELECT CASE reboot
                WHEN 0 THEN 'false' 
                WHEN 1 THEN 'true' 
                ELSE reboot END AS reboot
      FROM daTable
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •