Hello,
I'm working with a Union All Query and I'm not quite sure I understand what exactly the query is doing.
I understand the query until I get to the union all, after that, I'm a bit lost. This may be a very simple query, but I'm not sure I understand its intent.
Below is the SQL:
SELECT Users.ID, Profiles.NAME, Users.NAME
FROM Users INNER JOIN Profiles ON Users.PROFILEID = Profiles.ID
WHERE (((Profiles.NAME)="Marketing User")) OR (((Users.NAME)="Bob Smith")) OR (((Users.NAME)="Bill Evans"));
UNION ALL select "00G70000001L9JCEA0", "Marketing User", "Queue" from [Utility_Date] where Utility_Date.date=date();
When I run the second query on it's own, it appears that the query is just taking "00G70000001L9JCEA0", "Marketing User", "Queue" as expressions where there is a match on the date. When I go back through the User and Profile tables, I do not find any records with the ID# above. Does this mean that if it can't identify the Profile as Marketing User, Bob Smith or Bill Evans from the Profile and User tables, that it will assign it to "Queue"?
I'm afraid I'm not as well versed in interpreting this. I'm just confused and would appreciate any help you could provide.
Thanks!
Andrea
I'm working with a Union All Query and I'm not quite sure I understand what exactly the query is doing.
I understand the query until I get to the union all, after that, I'm a bit lost. This may be a very simple query, but I'm not sure I understand its intent.
Below is the SQL:
SELECT Users.ID, Profiles.NAME, Users.NAME
FROM Users INNER JOIN Profiles ON Users.PROFILEID = Profiles.ID
WHERE (((Profiles.NAME)="Marketing User")) OR (((Users.NAME)="Bob Smith")) OR (((Users.NAME)="Bill Evans"));
UNION ALL select "00G70000001L9JCEA0", "Marketing User", "Queue" from [Utility_Date] where Utility_Date.date=date();
When I run the second query on it's own, it appears that the query is just taking "00G70000001L9JCEA0", "Marketing User", "Queue" as expressions where there is a match on the date. When I go back through the User and Profile tables, I do not find any records with the ID# above. Does this mean that if it can't identify the Profile as Marketing User, Bob Smith or Bill Evans from the Profile and User tables, that it will assign it to "Queue"?
I'm afraid I'm not as well versed in interpreting this. I'm just confused and would appreciate any help you could provide.
Thanks!
Andrea