I have two tables:- PERSON
and DATA
. What I want to do is fetch all details from PERSON
table and only two columns from DATA
table only when PERSON.personId = DATA.personId
.
I am using this query:-
SELECT *
FROM PERSON AND SELECT DATA.value, DATA.field
FROM DATA where PERSON.personId = DATA.personId;
But I think this is wrong syntax. Can anyone tell me what is the right syntax for it.