I am new to Oracle DBMS and I want to try the following:
I have an entity "Flight" with an attribute "DepartureTime", I want to know the number of flights at 2 different times and compare the count, then print which time has more flights
My attempt:
IF (SELECT COUNT(DepartureTime)
From Flight
WHERE DepartureTime='23:58')>
(SELECT COUNT(DepartureTime)
From Flight
WHERE DepartureTime='23:00')
BEGIN
PRINT 'First is bigger'
END
ELSE
BEGIN
PRINT 'Second is bigger'
END;
I am getting "Invalid SQL Statement"
Any help would be appreciated.