Results 1 to 2 of 2

Thread: select a fictional column

  1. #1
    Join Date
    May 2009
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default select a fictional column

    Hi,
    In mysql, I have a table A with fields f1,f1,f3,f4.
    I want to select some selected column values like f1,f2 and a new fictional column f5 whose value will always be 'luck'.
    say it should return

    f1 f2 f5
    ------------------
    a1 a2 luck
    b1 b2 luck
    c1 c2 luck

    Is there any way out??
    Thanks in advance!!!!!!
    Regards

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    Code:
    SELECT f1, f2, 'luck' AS f5 from tablename
    To choose the lesser of two evils is still to choose evil. My personal site

Bookmarks

Posting Permissions

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