SQL query syntax question
I am looking at the following query and I have a couple of questions about it.
I understand basic SQL syntax but I am not understanding some parts of the following query.
<cfquery name="GetPossibleUsers" datasource="bc">
SELECT uid, fname, lname
FROM UserInfo UI
WHERE uid IN (SELECT uid
FROM UserCampDates
WHERE CampDateID = #q_CampID#)
ORDER BY lname ASC
</cfquery>
1. Where it says "FROM UserInfo UI" I understand that "FROM UserInfo" would mean from the UserInfo table but I don't get the "UI" part. What would the UI part represent?
2. I presume the part:
WHERE uid IN (SELECT uid
FROM UserCampDates
WHERE CampDateID = #q_CampID#)
is a kind of compound query (if that is the right terminology) This seems pretty useful but I have not used this method. What would this be called?
