I have 3 tables Jobs, Quotes and Questions eg:-
Jobs
-----------
JobID
JobName
Quotes
-----------
JobID
UserID
Questions
-----------
JobID
UserID
I'm trying to get a grouped result set of JobID's where UserID = ? in either Quotes or Questions I don't think I can use a JOIN as the user may have entered questions but not a quote.
Nearest thing I have so far is this but the grouping obvously won't work, I'm also not familiar with UNION and think I might be going down the wrong path.
PHP Code:
SELECT
JobID, UserID
FROM Quotes
UNION ALL
SELECT
JobID, UserID
FROM Questions
WHERE UserID = ?