Viewing 5 posts - 1 through 6 (of 6 total)
Manage to get the right combination
SELECT distinct R1.FlightNum, R1.FromCityCode, R1.ToCityCode
FROM ...
August 2, 2008 at 8:42 pm
My code is not the result that should be
August 2, 2008 at 8:00 pm
Mate
Have tried it and it came with an error
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
SQL state: 42P10
August 2, 2008 at 7:42 pm
Thanks Young
I am totally new to SQL and i cant figure out what is wrong. Please if you could post the modify version of the query i've send....
August 2, 2008 at 12:10 pm
Have tried this query but seems not working
QUERY
------
SELECT distinct R1.FlightNum, R1.FromCityCode, R2.ToCityCode
FROMFlights R1, Flights R2
WHERE(R1.FromCityCode = R2.ToCityCode)
AND(R1.FlightNum < R2.FlightNum)
ORDER BYR1.FlightNum, R1.FromCityCode, R2.ToCityCode
TABLE
------
CREATE TABLE flights
(
flightnum numeric(2) NOT NULL,
...
August 2, 2008 at 11:19 am
Viewing 5 posts - 1 through 6 (of 6 total)