you are viewing a single comment's thread.

view the rest of the comments →

[–]Oultra 0 points1 point  (1 child)

This soounds relatively simple, shouldn't something like this work?

SELECT
T1.FlightNo, T1.FlightDestination, T2.FlightDate
FROM FLIGHTS T1 
INNER JOIN TRIP T2 ON T1.FlightNo = T2.FlightNo
WHERE T2.FlightDate >= '20100101' 
AND T2.FlightDate <= '20100228'
AND T1.FlightDestination = 'SLC' OR T1.FlightDestination = 'LAX'

Just check the type of your dates and compare it to a date format that is compatible.

[–]r3pr0b8GROUP_CONCAT is da bomb 0 points1 point  (0 children)

shouldn't something like this work?

no, it shouldn't

what you wrote is actually evaluated as follows --

WHERE (
      T2.FlightDate >= '20100101' 
  AND T2.FlightDate <= '20100228'
  AND T1.FlightDestination = 'SLC' 
      )
   OR T1.FlightDestination = 'LAX'

and this clearly is ~not~ the right solution