MySQL. Im stuck! - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

MySQL. Im stuck!

SAVE4IT Avatar
6y, 9m agoPosted 6 years, 9 months ago
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
SAVE4IT Avatar
6y, 9m agoPosted 6 years, 9 months ago
Options

All Comments

(5) Jump to unreadPost a comment
Comments/page:
1 Like #1
something like this?

select name, town, postcode from table
where hotel = "name of hotel"
order by visit date
1 Like #2
Bit rusty on MySQL but something like this:

SELECT name,town,postcode FROM clientTbl WHERE hotel="the jury's inn"
#3
Spriggan
something like this?

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


oldmanhouse
Bit rusty on MySQL but something like this:

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


simple!!!!
#4
Thanks!
#5
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

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!