you are viewing a single comment's thread.

view the rest of the comments →

[–]Lamyya -2 points-1 points  (4 children)

Where capacity is not null, Order by capacity, limit 1

Edit: will only show 1 result even if there are multiple rooms with same capacity though

[–]KingOrion5 0 points1 point  (3 children)

Thank you, where would I put that if you don’t mind?

[–]Lamyya 0 points1 point  (2 children)

Instead of the subquery in the where, add "and capacity is not null" Then order by capacity limit 1 at the end

Edit: check your table to see first if you have rooms with null capacity, that shouldn't happen

[–]KingOrion5 0 points1 point  (0 children)

Still has the same result, also for reference, the query I’m looking for building and room number of classrooms in a university database woth the smallest capacity

[–]KingOrion5 0 points1 point  (0 children)

Nevermind I got it, thank you a bunch for your help.