select a fictional column

Discussion in 'Databases' started by php_techy, Jun 11, 2010.

  1. #1
    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
     
    php_techy, Jun 11, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    SELECT f1, f2, 'luck' AS f5 FROM my_table;
     
    jestep, Jun 11, 2010 IP