Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002
    Location
    India
    Posts
    60

    Thumbs up Unanswered: need query or proc to achiev this complex functionality

    Hi there,
    I have three tables namely facil,pool and sale with the columns as specified below.
    Let us consider i have records in the tables as specified below. I have to write these records into
    pgfile.txt as specified below:
    Here the tables contain millions of records so i need a better query or proc to achieve this:

    facil:
    number start end start_date end_date Ocn
    732652 0000 9999 20040601 Null 7421
    732652 0000 9999 20020201 20040531 5555

    pool:
    number start end start_date end_date Ocn
    732652 1000 1999 20040516 Null 7299
    732652 1000 1999 20040101 20040515 7777
    sale:
    number start end start_date end_date Ocn
    732652 1010 1010 20031125 Null 8953
    732652 4001 null 20030909 Null 8829
    732652 4002 null 20030909 Null 8829
    732652 4010 null 20040701 Null 8829
    732652 4010 null 20040601 20040630 8953
    732652 4010 null 20040515 20040531 8829
    732652 4010 null 20040501 20040514 8953

    PgFile.txt:

    732652-00000999 2004060199999999 7421
    732652-00000999 2002020120040531 5555
    732652-10001009 2004051699999999 7299
    732652-10001009 2004010120040515 7777
    732652-10101010 2003112599999999 8953
    732652-10111999 2004051699999999 7299
    732652-10111999 2004010120040515 7777
    732652-20004000 2004060199999999 7421
    732652-20004000 2002020120040531 5555
    732652-40014002 2003090999999999 8829
    732652-40034009 2004060199999999 7421
    732652-40034009 2002020120040531 5555
    732652-40104010 2004070199999999 8829
    732652-40104010 2004060120040630 8953
    732652-40104010 2004051520040531 8829
    732652-40104010 2004050120040514 8953
    732652-40119999 2004060199999999 7421
    732652-40119999 2002020120040531 5555

    Thanks in Advance

    ~V~
    Thanks & Regards
    Manikandan

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >so i need a better query or proc to achieve this:
    Better than what?
    What have you tried?
    Whats wrong with your query which was not posted?
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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