我有一张名为 datetest 的表
CREATE TABLE "DATETEST"."DATETEST"
("FNAME" VARCHAR2(20 BYTE),
"DOB" DATE,
"STAFFNO" NUMBER NOT NULL ENABLE,
CONSTRAINT "DATETEST_PK" PRIMARY KEY ("STAFFNO"));
有以下数据
INSERT INTO "DATETEST"."DATETEST" (FNAME, DOB, STAFFNO) VALUES ('John', TO_DATE('01- OCT-45', 'DD-MON-RR'), '1')
INSERT INTO "DATETEST"."DATETEST" (FNAME, DOB, STAFFNO) VALUES ('Ann', TO_DATE('01-NOV-60', 'DD-MON-RR'), '2')
INSERT INTO "DATETEST"."DATETEST" (FNAME, DOB, STAFFNO) VALUES ('David', TO_DATE('24-MAR-58', 'DD-MON-RR'), '3')
INSERT INTO "DATETEST"."DATETEST" (FNAME, DOB, STAFFNO) VALUES ('Mary', TO_DATE('19-FEB-70', 'DD-MON-RR'), '4')
INSERT INTO "DATETEST"."DATETEST" (FNAME, DOB, STAFFNO) VALUES ('Susan', TO_DATE('03-JUN-40', 'DD-MON-RR'), '5')
INSERT INTO "DATETEST"."DATETEST" (FNAME, DOB, STAFFNO) VALUES ('Julie', TO_DATE('13-JUN-65', 'DD-MON-RR'), '6')
当我执行以下查询时
select * from datatest order by dob desc
我得到以下结果
FNAME DOB STAFFNO
-------------------- --------- -------
John 01-OCT-45 1
Susan 03-JUN-40 5
Mary 19-FEB-70 4
Julie 13-JUN-65 6
Ann 01-NOV-60 2
David 24-MAR-58 3
我无法弄清楚如何获得正确的订单。如何查询正确的订单?