Guest_imported
New member
- Jan 1, 1970
- 0
Good day,
Can someone help explain WHAT this correlated subquery is doing; it has stumped me for a couple of days and now I need some help. It looks not too hard, but it is REALLY taxing me. It references a table called ward, and sets up two aliases w1 and w2; number of beds is self explanetary...the query is this:
SELECT *
FROM ward w1
WHERE (SELECT COUNT (*)
FROM ward w2
WHERE w1.number_of_beds < w2.number_of_beds ) < 4
Obviously I can run the query, and I do not need to know specifics of the returned answer ( hence I have supplied JUST the query ), but I do not know the logic of what this is asking;
Any help greatly appreciated,
Regards - Mushki
Can someone help explain WHAT this correlated subquery is doing; it has stumped me for a couple of days and now I need some help. It looks not too hard, but it is REALLY taxing me. It references a table called ward, and sets up two aliases w1 and w2; number of beds is self explanetary...the query is this:
SELECT *
FROM ward w1
WHERE (SELECT COUNT (*)
FROM ward w2
WHERE w1.number_of_beds < w2.number_of_beds ) < 4
Obviously I can run the query, and I do not need to know specifics of the returned answer ( hence I have supplied JUST the query ), but I do not know the logic of what this is asking;
Any help greatly appreciated,
Regards - Mushki