I'm trying to join two tables.
Table1 looks like:
id
name
state
Table2 looks like:
fk_id
book_name
I need to answer a question like: find everyone who lives in Virginia who has read 'Harry Potter' AND 'Gone With the Wind'.
select * from table1 where table1.id=table2.fk_id and book_name='Harry Potter' AND book_name='Gone With the Wind' does not work.
I'm sure there is a simple and obvious way to do this but I can't seem to figure it out myself or find anything in the forums or SQL tutorials, etc. Thanks in advance for any help you can provide.
Table1 looks like:
id
name
state
Table2 looks like:
fk_id
book_name
I need to answer a question like: find everyone who lives in Virginia who has read 'Harry Potter' AND 'Gone With the Wind'.
select * from table1 where table1.id=table2.fk_id and book_name='Harry Potter' AND book_name='Gone With the Wind' does not work.
I'm sure there is a simple and obvious way to do this but I can't seem to figure it out myself or find anything in the forums or SQL tutorials, etc. Thanks in advance for any help you can provide.