Joins that produce a result set that includes only the rows of the joining tables that meet the restriction are called inner joins. Rows that do not meet the join restriction are not included in the joined table.
If you require the joined table to include all the rows from one of the tables, regardless of whether they meet the restriction, use an outer join.
select au_id, titles.title_id, title, price from titleauthor, titles where titleauthor.title_id = titles.title_id and price > $15
ANSI-standard inner join syntax is:
select select_list from table1 inner join table2 on join_condition
select au_id, titles.title_id, title, price from titleauthor inner join titles on titleauthor.title_id = titles.title_id and price > 15
au_id title_id title price ---------- -------- ------------------------ ----- 213-46-8915 BU1032 The Busy Executive’s Datab 19.99 409-56-7008 BU1032 The Busy Executive’s Datab 19.99 . . . 172-32-1176 PS3333 Prolonged Data Deprivation 19.99 807-91-6654 TC3218 Onions, Leeks, and Garlic: 20.95 (11 rows affected)
select title_id, pub_name from titles, publishers where titles.pub_id = publishers.pub_id
select title_id, pub_name from titles left join publishers on titles.pub_id = publishers.pub_id
begin tran
update titles set price = price * 1.25 from titles inner join publishers on titles.pub_id = publishers.pub_id and publishers.state = "CA"