Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Oracle - column aliasing...

  • 07-05-2004 03:19PM
    #1
    Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭


    So I have this query...
    SELECT  foo as bar
      FROM  mytable
    

    OK...obviously my query is more complex than that, but its pretty irrelevant to my question :)

    The problem is that I don't want to alias foo to bar. I want to alias foo to 'ba r'. But Oracle doesn't seem to want to let me.

    in MSSQL, I could just do :
    SELECT  foo as 'ba r'
      FROM  mytable
    

    Will Oracle let me do this at all, or should I do something like :
    SELECT  foo as 'ba_r'
      FROM  mytable
    
    and then post-process the recordset in my app, replacing the _ with a space char in each column name after I read them from the recordset definition?

    Any thoughts?

    jc


Comments

  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    Duh.
    SELECT  foo as "ba r"
      FROM  myTable
    

    TFIF...

    jc


Advertisement