Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
546 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
You won't spoil it TOTOally, huh? D
MYSQL solution:
select sub1.ContName as Continent, eventName as Event from tblEvent e
join tblCountry ctr on ctr.CountryID = e.CountryID
join (
select cont1.ContinentID, cont1.ContinentName as ContName, count(e1.EventID) as eventCount
from tblEvent e1
join tblCountry ctr1 on ctr1.CountryID = e1.CountryID
join tblContinent cont1 on cont1.ContinentID = ctr1.ContinentID
group by cont1.ContinentID, cont1.ContinentName
order by eventCount
limit 3) as sub1
on sub1.ContinentID = ctr.ContinentID
MYSQL solution
For mysql-typical error 1235 see this https://stackoverflow.com/questions/17892762/mysql-this-version-of-mysql-doesnt-yet-support-limit-in-all-any-some-subqu
SELECT EventName , EventDetails
FROM tblEvent e1
WHERE e1.CountryID NOT IN
( SELECT sub1.CountryID FROM -- wrapping due due Error code: 1235
(SELECT c1.CountryID FROM tblCountry c1
ORDER BY c1.CountryName DESC
LIMIT 30) sub1
)
AND e1.CategoryID NOT IN
(
SELECT sub2.CategoryID FROM -- wrapping due due Error code: 1235
(SELECT cat1.CategoryID FROM tblCategory cat1
ORDER BY cat1.CategoryName DESC
LIMIT 15) sub2
)
ORDER BY e1.EventDate
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.