0
I am unable to figure out what the answer is. Could anyone help me out?
Write a query to display the building type name of the meter number 'SG824012'. My ans : select name from building_type where id in (select id from building where id in (select building_id from meter where meter_number='sg824012'));
2 Answers
+ 3
Can you please provide the task number?
+ 1
nama purna chandrika some SQL engines require that all subqueries are named with the phrase AS <name>, even though you might not use the name. SQL Server is one that I know requires it.
For example:
(... WHERE id IN (SELECT building_id FROM meter WHERE meter_number='SG824012') AS BuildingId) ...
Notice that I added AS BuildingId. You would also use similar syntax on the subquery that contains that subquery.