DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Please Help me solve this SQL

  1. #1
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    409
    Hi All,
    Excuse me for asking very stupid SQL question. Say I have a transaction table called trans_test having one of columns as mod_date ( this is defined as datetime type). I need to list all records inserted into this table during past half hour.

    Oracle in my home computer is hosed up and therefore not able to test the SQL myself. So guys please try to help me.

    Thanks

    -- Dilip

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    select sysdate - 1/48 from dual;

  3. #3
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    409
    Thanks Pando. But this will return me the time that was half hour ago. I need this time to compare with column values of my table.

    something like :

    select * from trans_table where mod_date > sysdate - 1/48;

    where mod_date is of type Datetime.

    Do I need to use to_date function in SQL? or any other function?

    I am not quite sure of syntax. So just wanted to make whether my syntax is right. I dont have sqlplus working in my machine and I need to help a friend who has asked me for this.

    Thanks for the help.
    -- Dilip

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    that should work, date - date still gives you date datatype

  5. #5
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    409
    Thanks Again Pando. Just needed a nod.
    -- Dilip

Posting Permissions

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


Click Here to Expand Forum to Full Width