Groups

    MySQL. Im stuck!

    Here is the task:

    List the name, town and postcode of all clients making visits to a certain hotel in chronological order.

    What is the SQL Query that would do this?

    I have been trying to find the correct solution for hours - cannot find it!

    -SAVE4IT

    5 Comments

    something like this?

    select name, town, postcode from table
    where hotel = "name of hotel"
    order by visit date

    Bit rusty on MySQL but something like this:

    SELECT name,town,postcode FROM clientTbl WHERE hotel="the jury's inn"

    Spriggan;7917775

    something like this?select name, town, postcode from tablewhere hotel = … something like this?select name, town, postcode from tablewhere hotel = "name of hotel"order by visit date



    oldmanhouse;7917785

    Bit rusty on MySQL but something like this:SELECT name,town,postcode FROM … Bit rusty on MySQL but something like this:SELECT name,town,postcode FROM clientTbl WHERE hotel="the jury's inn"



    simple!!!!

    Original Poster

    Thanks!

    Using the information you have now removed from your last post...

    SELECT
    [Bookinginfo].[Guest ID],
    [Bookinginfo].[Date of arrival],
    [Bookinginfo].[Hotel Name],
    [Hotel info].PostCode

    FROM
    [Bookinginfo]

    INNER JOIN [Hotel info] ON
    [Bookinginfo].[Hotel Name] = [Hotel info].[Name of Hotel]

    WHERE
    [Bookinginfo].[Hotel Name])="Name of Hotel"

    ORDER BY
    [Bookinginfo].[Date of arrival];


    Note that the Name of the Guest cannot be provided as you did not state where this was stored.

    BFN,

    fp.

    [EDIT]: If the reponses have not offered enough assistance, please advise further. Thanks.
    Post a comment
    Avatar
    @
      Text
      Top Discussions
      1. I would not recommend anyone to buy tickets in viagogo22
      2. HP Instant Ink 4 month trial setup?1827
      3. Are the free antivirus any good?55
      4. Disney descendants duvet22

      See more discussions