我有一个问题,这就是我所拥有的
SQL> desc trktripleg
Name Null? Type
----------------------------------------- -------- ----------------------------
T# NOT NULL NUMBER(10)
LEG# NOT NULL NUMBER(2)
DEPARTURE NOT NULL VARCHAR2(30)
DESTINATION NOT NULL VARCHAR2(30)
我尝试执行以下操作
SQL> select destination,departure from trktripleg where T#=15;
DESTINATION DEPARTURE
------------------------------ ------------------------------
Adelaide Melbourne
Melbourne Sydney
我怎么弄成这样...
SOURCE DESTINATION DESTINATION2
Adelaide Melbourne Sydney
假设只有 1 个目的地
SQL> select destination,departure from trktripleg where T#=11;
DESTINATION DEPARTURE
------------------------------ ------------------------------
Sydney Melbourne
SOURCE DESTINATION DESTINATION2
Adelaide Melbourne
我现在正在查看,就像我提供 T# 一样,它将显示源目的地出发
一些原始插入数据..
INSERT INTO TRKTRIPLEG VALUES(11, 1, 'Melbourne', 'Sydney');
INSERT INTO TRKTRIPLEG VALUES(15, 1, 'Sydney', 'Melbourne');
INSERT INTO TRKTRIPLEG VALUES(15, 2, 'Melbourne', 'Adelaide');
感谢所有帮助。我正在使用 oracle sql。