have tables like this
Table "checklist"
idCardno
name
permAddress
datetime
Table "persons"
name
idcardno
photo
now i want my sqlquery be
idCardno | name | permAddress | photo
-----------------------------------------------
A123456 | John Doe | 302 xyz | 1.gif
the photo should be the corresponding one for the idcardno.
how can i achieve the result like this ? what will my sql query be ?
thanks
If
idCardno <-> idcardnois the shared key between the two tables and the name you want in output is the one from persons, simply use JOIN: