Our training courses

Other training resources

Our training venues

Why we are different

Details for gemini132

gemini132 has participated in the following threads:

Added by gemini132 on 13 Aug 2018 at 13:12

I managed to get until the last part but still when sorting the results as requested the are two countries misssing, any ideas on the tweak that needs to be done to the query to get these two counties listed?

SELECT Country
,KmSquared
,ABS(KmSquared/20761) AS WalesUnits
,ABS(KmSquared)-((KmSquared/20761)*20761) AS AreaLeftOver
,CASE
WHEN KmSquared > 20761 THEN CAST(KmSquared/20761 AS VARCHAR(20)) 
+ ' x ' + 'Wales plus' + ' ' + CAST((KmSquared)-((KmSquared/20761)*20761
) AS VARCHAR(25)) + ' ' + 'sq. km.'
WHEN KmSquared <= 20761 THEN 'Smaller than Wales' 
END AS WalesComparison
FROM CountriesByArea
WHERE kmSquared <= ALL (SELECT KmSquared 
FROM CountriesByArea
WHERE ABS(20761 - KmSquared) < 500)

Head office

Kingsmoor House

Railway Street

GLOSSOP

SK13 2AA

London

Landmark Offices

99 Bishopsgate

LONDON

EC2M 3XD

Manchester

Holiday Inn

25 Aytoun Street

MANCHESTER

M1 3AE

© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.

End of small page here
Please be aware that our website uses cookies!
I'm OK with this Tell me more ...