I have 2 tables: person_concern
and person
. They both have a code column
and person
has a dept column
. I want to select data from person_concern
table where the dept
column in person
table = 30.
Basically the person
table has a different code for each row and then the person is put in a department. So i can have multiple rows in the person
table with the same dept
field.
The person_concern
table is for writing problem concerns for people. It has a code to know which person its referring to which id get from the person
table. So i want to select data from that person_concern
table where the code matches the code from the person table and that person is from a certain dept
such as 30.
Hope that makes sense... Here's what ive tried so far but get an invalid number error.
select
PERSON_CONCERNS.CODE
PERSON_CONCERNS.ENTRY_DATE
PERSON_CONCERNS.ENTRY_OPR
PERSON_CONCERNS.DISCUSSION
from PERSON_CONCERNS
inner join PERSON on PERSON_CONCERNS.CODE = PERSON.CODE
where PERSON.DEPT = 30