The question "When I do a SELECT * FROM TABLE_NAME, the DepartureTime and ArrivalTime display a date (which I have not entered). How do I display the date in the first column and time in the other 2 columns?" as I understand tells that DepartureTime and ArrivalTime columns are populated with date and time (as it is quite usual). I assume that your data looks something like here:
WITH
flights (FLIGHT_OPERATOR, FLIGHT_FROM, FLIGHT_TO, DEPARTURE, ARRIVAL, SOME_OTHER_COL) AS
(
Select 'Vueling', 'Barcelona', 'Paris', To_Date('01.11.2022 10:45', 'dd.mm.yyyy hh24:mi'), To_Date('01.11.2022 12:30', 'dd.mm.yyyy hh24:mi'), 'Some other stuff' From Dual Union All
Select 'RyanAir', 'Barcelona', 'Dublin', To_Date('01.11.2022 11:10', 'dd.mm.yyyy hh24:mi'), To_Date('01.11.2022 13:00', 'dd.mm.yyyy hh24:mi'), 'Some other stuff' From Dual Union All
Select 'KLM', 'Barcelona', 'Amsterdam', To_Date('01.11.2022 20:10', 'dd.mm.yyyy hh24:mi'), To_Date('01.11.2022 23:00', 'dd.mm.yyyy hh24:mi'), 'Some other stuff' From Dual Union All
Select 'Lufthansa', 'Barcelona', 'Frankfurt', To_Date('01.11.2022 23:25', 'dd.mm.yyyy hh24:mi'), To_Date('02.11.2022 02:20', 'dd.mm.yyyy hh24:mi'), 'Some other stuff' From Dual
)
Selecting all from table looks, probably, like below:
FLIGHT_OPERATOR |
FLIGHT_FROM |
FLIGHT_TO |
DEPARTURE |
ARRIVAL |
SOME_OTHER_COL |
Vueling |
Barcelona |
Paris |
01-NOV-22 |
01-NOV-22 |
Some other stuff |
RyanAir |
Barcelona |
Dublin |
01-NOV-22 |
01-NOV-22 |
Some other stuff |
KLM |
Barcelona |
Amsterdam |
01-NOV-22 |
01-NOV-22 |
Some other stuff |
Lufthansa |
Barcelona |
Frankfurt |
01-NOV-22 |
02-NOV-22 |
Some other stuff |
As the question was "How do I display the date in the first column and time in the other 2 columns?" I would say that you are looking for this:
Select
FLIGHT_OPERATOR, FLIGHT_FROM, FLIGHT_TO,
DEPARTURE, To_Char(DEPARTURE, 'hh24:mi') "DEPARTURE_TIME",
ARRIVAL, To_Char(ARRIVAL, 'hh24:mi') "ARRIVAL_TIME",
SOME_OTHER_COL
From
flights
Order By
DEPARTURE, FLIGHT_OPERATOR
Result would be:
FLIGHT_OPERATOR |
FLIGHT_FROM |
FLIGHT_TO |
DEPARTURE |
DEPARTURE_TIME |
ARRIVAL |
ARRIVAL_TIME |
SOME_OTHER_COL |
Vueling |
Barcelona |
Paris |
01-NOV-22 |
10:45 |
01-NOV-22 |
12:30 |
Some other stuff |
RyanAir |
Barcelona |
Dublin |
01-NOV-22 |
11:10 |
01-NOV-22 |
13:00 |
Some other stuff |
KLM |
Barcelona |
Amsterdam |
01-NOV-22 |
20:10 |
01-NOV-22 |
23:00 |
Some other stuff |
Lufthansa |
Barcelona |
Frankfurt |
01-NOV-22 |
23:25 |
02-NOV-22 |
02:20 |
Some other stuff |
So, the Departure and Arrival columns containe both the date and the time. You can select whatever part of that DateTime structure you want. In this answer I didn't take any part for Departure and Arrival but the columns as a whole. Their display format is defined by NLS_DATE_FORMAT (you can format it using NLS or some other way of displaying date/time). I just extracted time parts for departure and arrival dates in separate columns (like in the question) as there could be some night flights with different dates of departure and arrival.
Regards...