Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2008
    Posts
    2

    Post Unanswered: Need help to find an alternative for rowid concept in Sybase 12.5.0.3

    Hi All,

    I am using Sybase 12.5.0.3
    There are two tables say table1 and table2 having one to many relationship

    table1
    (
    Key1
    Key2
    Key3

    data1
    data2
    )

    table 2
    (
    UKey1
    UKey2
    Key1
    Key2
    Key3

    New_data1
    New_data2
    )
    table1 and table2 can be joined using Key1,Key2,Key3 columns. According to the data model and business logic,for each row of table1 there will be 4 rows in table2. For a simmilar combination of Key1,Key2,Key3 columns in table2 there will 4 different New_data1 returned.

    I need to write a query or a stored procedure to select New_data1
    from table2 with a join on table1.
    As per the data model and the business logic 4 rows will be returned by the query. The New_data1 values returned by the 4 rows should be captured in 4 columns.


    I thought of using rowid concept but the version I am using doesn't support it.

    Can anyone suggest me any alternative approach

    Thanks & Regards
    Shayantan Gupta

  2. #2
    Join Date
    Apr 2008
    Posts
    2
    Sorry I forgot to add.
    I thought of writing a view also where I can include 1 auto incrementor column and later query this view using this auto incremented value.
    If anyone can help me out to find how to include an auto incrementor column.

  3. #3
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Maybe use an IDENTITY column
    It contains system-generated values that uniquely identify each row in a table (can have gaps).

Posting Permissions

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