RECURSIVE SELECT PARADOX!

  • Hello Friends,

    I have created a database trigger that tracks specific column updates. This database trigger inserts updated columns to another database table named "History_OrdersTable".

    When I execute a simple select statement I got the following result:

    ***********************************************

    SELECT * FROM History_OrdersTable

    lOrderNo OrderDate DelivDate UserName modifiedDate Action                        

    ------------------------------------------------------------------------- -

    5354     2005-06-15  2005-06-17     bwb       2006-08-10      BEFORE

    5354     2005-06-15  2005-06-19     bwb       2006-08-10      AFTER

    5013     2005-06-15  2005-06-20     bwb       2006-08-10      BEFORE

    5013     2005-05-15  2005-06-20     bwb       2006-08-10      AFTER

    ************************************************

    I would like to convert this table as

    lOrderNo,OrderDate,DelivDate,UserName,Before,After,ModifiedDate,Action

    columns..

    How can I do this? A recursive SELECT statement or any other method?

     

    Please Help..

     

  • Can you post an example of how you want your data to look?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • I want to show modified column with its original value.That's all..

    For example there are some modified values which belong to same OrderID. I want to combine two results into one row

  • I am still not clear on what you need.  I see that you have added Before and After to your column list in your new SELECT.  Can you post an example of how you want your new results to look like just as you did with your 'simple' select?  Are you just wanting to get a different result set back from your History_OrdersTable table?

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply