Тема: Тип связи
Показать сообщение отдельно
Старый 25.04.2002, 20:20   #10  
ddadream is offline
ddadream
Участник
Аватар для ddadream
 
130 / 17 (1) ++
Регистрация: 30.11.2001
Адрес: moscow
Для Кучи.

Смотри: таблицы table1 (id,table2_id),
table2 (id,name)
table1 (1,NULL)
(2,1)
(3,NULL)
(4,2)
(5,3)

table2 (1,'Вася')
(2,'Петя')
(3,'Гога')
(4,'Степа')

Select table1.id,table2.name
from table1 left outer join table2 on table1.table2_id = table2.id

получится

1,NULL
2,'Вася'
3,NULL
4,'Петя'
5,'Гога'

это левый outer join

Select table1.id,table2.name
from table1,table2
where table1.table2_id = table2.id

2,'Вася'
4,'Петя'
5,'Гога'

типичный пример inner joinа