Problems with Group BY Clause

  • I'll take a look, but I'm going to need more than 1 row of data. Can you give me data for all the dest airports like 'b%' (the ones you illustrated in the last post?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • No problem Gail,

  • Should do.

    Which of those rows is the query supposed to return?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Any which the departure date is greater than todays date and WHERE City.name (when joined with the City table) LIKE 'B%'.

    I limit the returned results to 20 as they are used to display a selection of lead in prices for flights on a web page.

    Hope I'm making this clear enough for you.

    Thanks again Mark

  • No, not really.

    You said before you want 1 row per departure airport, the one with the cheapest price. Now you say "Any which the departure date is greater than todays date and WHERE City.name (when joined with the City table) LIKE 'B%'."

    Which is it?

    I don't want to be guessing again as to which rows the query should be returning. It's wasting time.

    Out of the sample data you gave me, which rows do you want returning?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Sorry about the confusion,

    I would like the query to return 1 row per departure airport, preferably the one with the cheapest price.

    Thanks again

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply