Identifying through many columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jaimate
    New Member
    • Feb 2010
    • 2

    Identifying through many columns

    I have a huge table with 10m entries. But there is only 500,000 different. The only way to identify each different entry is concatenating many columns. The final result is a 20 characters long, which is not very useful for calculations. I would prefer a number.

    Can I create a variable stored in a column that increases every time there is a change in some of the other columns? Is there a way to simplify the 20-characters-long variable?

    See the example
    Click image for larger version

Name:	ExampleSQL.jpg
Views:	1
Size:	16.3 KB
ID:	5415876


    SQL on DB2 v9.1



    Thanks a million
    Last edited by jaimate; Feb 1 '10, 09:20 AM. Reason: Title ambiguous
  • hitendrap
    New Member
    • Sep 2009
    • 9

    #2
    The solution is very simple, you must create a VIEW for that table !!!,
    whatever query you are firing to get the above result (shown in screenshot), just type that in CREATE VIEW statement !

    Comment

    • jaimate
      New Member
      • Feb 2010
      • 2

      #3
      Thanks a million for your response.

      What I really mean is that I don't have the column identifier. It is only there to see what I need. How can I get it in SQL?

      Comment

      • hitendrap
        New Member
        • Sep 2009
        • 9

        #4
        What I've understood is that
        you have displayed the values in column "CONCATENAT E" by actually contatenating the character values in other columns right ?
        & suppose the value of row1 & column 7 changes from A to B then the value will automatically change to B in the "CONCATENAT E" column

        Still may answer is the same, CREATE a VIEW.

        Plz. read how to create a view & more important learn what is a VIEW of a table in relational database.

        Comment

        Working...