Need an SQL statement that can produce results from one table with two columns in another table -
here question.
i have 2 tables, table named = authors, , table b named = books.
in table a, have primary key called = au_id which, table holds authors first , lastname , country.
table b, has columns book_id, published_date, genres, , au_id (which put same number table a's au_id.
example,
authors
table
[au_id (primary key)],[au_fname],[au_lname],[city],[country] 1, robert, jordan, carolina, usa
books
table
[book_id(primary key)],[book_title],[genres],[publisher],[release_date],[au_id] 1, eye of storm, fantasy, tor books, january 2004, 1
how can create query can grab books author?
i tried google question, cannot seem figure out.
you need join tables on au_id
column:
select a.au_fname, a.au_lname, b.book_title books b inner join authors on b.au_id = a.au_id a.au_lname = 'lastname'
Comments
Post a Comment