Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2008
    Posts
    48

    Unanswered: Alias Name For Columns

    Is there a way to give alias name to the column , can a column have two names
    for example :

    Table1 has 2 columns Emp_Name, Emp_no

    i can query table as :

    select Emp_Name, Emp_no from Table1


    i want to query table as :

    select EmpName, Empno from Table1

    i do not want to use
    select Emp_Name as EmpName, Emp_no Empno from Table1

    Thanks in advance

    =======================
    DB2 9 Windows

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Create a view.

  3. #3
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    Why not simply build a table with the names that you want? Why make things more complicated then they already are.
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  4. #4
    Join Date
    Nov 2008
    Posts
    48
    we have abt 300 tables in some tables column is refered as emp_id in others emp_no or emp, empno. the naming issue is not just for one column there are many columns like that.

    This is old application and i cannot recreate tables, creating view looks like good idea.

    Thanks for ur replies n_i and cougar800

  5. #5
    Join Date
    Feb 2008
    Posts
    40
    hey, did anyone got solution for the same, as we are also facing the same issue ???

Posting Permissions

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