I have a working query as follows
SELECT r.realname contractor_name, u.uid contractor_uid, ...
How can I select just contractor_uid from this result? I have tried
select contractor_uid from (SELECT r.realname contractor_name, u.uid contractor_uid...)
But I get the error message
Every derived table must have its own alias
Add a dummy name after the sub query, i.e.: