locked
How to use order by clause for time? RRS feed

  • Question

  • User-1148373670 posted

    Hi,

    I am using oracle database and in database i have one column appdate that contain date with time.

    I have five records with same date but timing is diffrent.

    How to write a oracle query to orader the data based on timing asc and dsc order.

    Please provide some query and solve my issue.

    thanks in advance.

    Wednesday, September 7, 2011 12:59 AM

Answers

  • User1577733570 posted

    Hi,

    If you are not making any conversion to the DateTime field, then
    it will sort the date part as well as the time part.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 7, 2011 1:20 AM
  • User1927273029 posted

    Hello,

    Do not convert the datetime to any other data type and use normal ordering. It will order time by itself

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 7, 2011 1:30 AM

All replies

  • User1577733570 posted

    Hi,

    If you are not making any conversion to the DateTime field, then
    it will sort the date part as well as the time part.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 7, 2011 1:20 AM
  • User1927273029 posted

    Hello,

    Do not convert the datetime to any other data type and use normal ordering. It will order time by itself

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 7, 2011 1:30 AM
  • User-1148373670 posted

    I got solution.

    Thanks All

    Wednesday, September 7, 2011 1:43 AM