0

我正在尝试编写一个 SQL 查询,它只会date-time根据Oracle DB. 这是我尝试过的:

 String getPricesQuery = "SELECT * FROM price WHERE SELECTIONID IN (SELECT ID" +
" FROM selection" +
" WHERE EVENTID =" + eventID + ") ORDER BY TIME(TIMEOFISSUE) ASC";

我读到该TIME()函数可用于提取 a 的时间部分,但我想在尝试在子句Date-Time中使用它时它会使其变得更加复杂?ORDER BY

4

2 回答 2

5

您可以使用 :

ORDER BY to_char(TIMEOFISSUE, 'hh24miss')
于 2013-07-17T09:38:41.167 回答
-1

ORDER BY TIMEOFISSUE ASC 就足够了,或者你可以使用 desc。

于 2015-06-24T04:44:52.717 回答