Reputation: 9561
I have a table called users and another called tickets
The users table has
id
firstName
lastName
the tickets table has the following fields
id
ticket
issuedTo
fine
user (numeric id that corresponds to the id field of the user table)
status
I am trying to design a query where I can find all the queries that were created by a specific person
SELECT tickets.*, user.firstname, user.lastname FROM tickets WHERE tickets.user INNER JOIN user.id AND user.firstname="John" AND user.lastname="Doe"
I tried the above but didn't work so there must be something wrong with my SQL Query. Please help
I am using a Microsoft Access Database 2007.
Upvotes: 0
Views: 64
Reputation: 57593
Try this
SELECT u.firstName, u.lastName, t.*
FROM users u INNER JOIN tickets t
ON u.id = t.user
WHERE u.firstName = ???
AND u.lastName = ???
Upvotes: 3