Results 1 to 4 of 4

Thread: Database

  1. #1
    Join Date
    Feb 2009
    Posts
    6

    Unanswered: Database

    i have address_rule table with destination_prefix,value and created date.
    if we update value in address_rule then the destination_prefix,old_value and modified_date will be stored in another table audit_address_rule.

    now my requirement is i want to retrive value for particular destination on given date..

    plz help

    Jeyasree.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Post the DDL for the tables
    Post sample data
    Post the expected result of your SELECT statement based on the sample data

  3. #3
    Join Date
    Feb 2009
    Posts
    6
    i have two tables billing_rules,audit_billing_rules as shown below.
    if i update any value in billing rules then it will be updated in billing_rules table and the old record will be added to the audit_billing_rules with modified date.
    but billing_rules has only created date.

    i need to retrive values from tables at particular date i have given..
    it may be modified date,created date or in between date..



    billing_rules table:
    rule_id | type_code | rule_name | description | created_by | creation_date | modified_by | modified_date | subscriber_id
    ---------+-----------+----------------+-------------+------------+---------------+-------------+-------------------------------+---------------
    1 | address | addrulechanged | sample | admin | | admin | 2009-02-10 17:41:09.718+05:30 | nexge

    audit_billing_rules table:

    serial_no | rule_id | type_code | rule_name | description | modified_by | modified_date | ip_address
    -----------+---------+-----------+-----------+---------------+-------------+----------------------------------+--------------
    1 | 1 | address | addrule | Address Rule3 | admin | 2009-01-13 13:54:54.359+05:30 | 131.10.20.38
    10 | 1 | address | addrule | Address Rule3 | admin | 2009-01-22 17:41:17.358217+05:30 | 131.10.20.38
    12 | 1 | address | addrule | Address Rule3 | admin | 2009-02-10 17:28:48.142735+05:30 | 131.10.20.38
    13 | 1 | address | addrule | Address Rule3 | admin | 2009-02-10 17:31:00.293378+05:30 | 131.10.20.38
    14 | 1 | address | ggggg | kkkkk | admin | 2009-02-10 17:32:14.755789+05:30 | 131.10.20.38



    Thank you,
    jeyasree

  4. #4
    Join Date
    Feb 2009
    Posts
    6
    i have two tables billing_rules,audit_billing_rules as shown below.
    if i update any value in billing rules then it will be updated in billing_rules table and the old record will be added to the audit_billing_rules with modified date.
    but billing_rules has only created date.

    i need to retrive values from tables at particular date i have given..
    it may be modified date,created date or in between date..

    single query should not involve two tables..

    i need separate queries for retriving from two tables and i can include tat queries using some conditions in java





    billing_rules table:
    rule_id | type_code | rule_name | description | created_by | creation_date | modified_by | modified_date | subscriber_id
    ---------+-----------+----------------+-------------+------------+---------------+-------------+-------------------------------+---------------
    1 | address | addrulechanged | sample | admin | | admin | 2009-02-10 17:41:09.718+05:30 | nexge

    audit_billing_rules table:

    serial_no | rule_id | type_code | rule_name | description | modified_by | modified_date | ip_address
    -----------+---------+-----------+-----------+---------------+-------------+----------------------------------+--------------
    1 | 1 | address | addrule | Address Rule3 | admin | 2009-01-13 13:54:54.359+05:30 | 131.10.20.38
    10 | 1 | address | addrule | Address Rule3 | admin | 2009-01-22 17:41:17.358217+05:30 | 131.10.20.38
    12 | 1 | address | addrule | Address Rule3 | admin | 2009-02-10 17:28:48.142735+05:30 | 131.10.20.38
    13 | 1 | address | addrule | Address Rule3 | admin | 2009-02-10 17:31:00.293378+05:30 | 131.10.20.38
    14 | 1 | address | ggggg | kkkkk | admin | 2009-02-10 17:32:14.755789+05:30 | 131.10.20.38



    Thank you,
    jeyasree

Posting Permissions

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