#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    5
    Rep Power
    0

    combine columns in oracle sql


    Is it possible to combine 2 columns within a table for a query? If so, what is the correct format of the command. For example: I have a table "Artist" with a column for the last name (artistlast) and a column for the firstname (artistfirst). I need to do a query that combines the two that would be known as artistname.

    Thanking you in advance for your help.

    Cheryl
  2. #2
  3. No Profile Picture
    Senior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Canada
    Posts
    308
    Rep Power
    12
    You can comabine two columns using concatenating operator || (double vertical bars), look at the following example:

    SELECT firstname||'-'||lastname name,class,grade from students
    /

    Regards,

IMN logo majestic logo threadwatch logo seochat tools logo