我的訪問表如下:Oracle。如何輸出日期和時間?
insert into Visit
values(12, to_date('19-JUN-13', 'dd-mon-yy'), to_date('19-JUN-13 12:00 A.M.' , 'dd-mon-yy hh:mi A.M.'));
insert into Visit
values(15, to_date('20-JUN-13', 'dd-mon-yy'), to_date('20-JUN-13 02:00 A.M.' , 'dd-mon-yy hh:mi A.M.'));
insert into Visit
values(18, to_date('21-JUN-13', 'dd-mon-yy'), to_date('21-JUN-13 10:30 A.M.' , 'dd-mon-yy hh:mi A.M.'));
當我嘗試進行查詢: select * from Visit
我得到:
SQL> select * from visit;
SLOTNUM DATEVISIT ACTUALARRIVALTIME
---------- --------- ------------------------------
12 19-JUN-13 19-JUN-13
15 20-JUN-13 20-JUN-13
18 21-JUN-13 21-JUN-13
SQL> spool off;
怎麼來的時候是不是有?
是否應該是HH:MI:SS而不是HH:M:SS? –
正確@MaximEliseev,謝謝你讓我知道!這是一個錯字。我已經用您的修復程序更新了答案。 –