Помогите составить запрос. MSQL. Связь - многим ко многим

 
0
 
C++ | MS SQL Server

user posted image

Есть таблица person, door, person_door
person - сотрудники
door - двери
person_door - содержит связи таблиц

Как написать запрос чтоб видеть сколько привязанных дверей у сотрудника.


SELECT shortFIO ФИО, name_room Двери
FROM door
JOIN Person ON personID = doorID
JOIN PersonID_DoorID ON PersonID_DoorID.personID = PersonID_DoorID.doorID


задан 17:44, 31.12.2017
ava 

Ответы (3)

наверно бред, но пробывал так:


SELECT person.shortFIO ФИО, door.name_room Двери
FROM person, door
JOIN PersonID_DoorID ON PersonID_DoorID.personID = PersonID_DoorID.doorID

WHERE person.shortFIO = 'Иванов Иван Иванович'

отвечен 20:46, 31.12.2017
ava 


Вот такой запрос вернёт имя и количество дверей.


select person.shortFIO, count(doorID) from person left outer join personID_DoorID on personID_DoorID.personID=person.personID group by person.shortFIO;

отвечен 07:45, 01.01.2018
ava 
a0730
145


20180829 junda
uggs outlet
golden goose sneakers
furla handbags
jordan shoes
canada goose
kate spade outlet
soccer jerseys
soccer shoes
nike revolution
ray ban sunglasses
gucci handbags
chloe outlet
polo ralph lauren
bulls jerseys
canada goose outlet
ray ban sunglasses
pandora charms
michael kors outlet
michael kors outlet
swarovski outlet
ray ban sunglasses
burberry outlet
air jordan 4
new york knicks jersey
michael kors uk
polo ralph lauren
nike blazer pas cher
burberry outlet
harden shoes
jerseys from china
true religion outlet
michael kors outlet
christian louboutin boutique
michael kors outlet
mishka clothing
reebok outlet store
coach outlet
cheap jordans
oakley sunglasses
fitflops shoes
ralph lauren polo
ysl outlet
canada goose outlet
mulberry handbags
nhl jerseys
canada goose jackets
michael kors outlet
uggs
merrell shoes
isabel marant outlet
michael kors wallets
canada goose outlet
jordan shoes
canada goose outlet
givenchy jewelry
fitflops sale
golden state warriors jerseys
true religion jeans
ecco shoes
cheap jordans
polo ralph lauren
gucci outlet
cazal sunglasses
carrera sunglasses
fitflops sale clearance
brequet wathes
jordan 32
alexander mcqueen shoes
pandora charms
michael kors outlet
cheap snapbacks
uggs outlet
links of london
karen millen dresses
longchamp outlet
fila shoes
hawks jerseys
canada goose outlet
canada goose outlet
moncler outlet
michael kors outlet
oakley sunglasses
cavaliers jerseys
longchamp bags
prada outlet
ugg boots
air jordan 12
barcelona jersey
bottega veneta outlet
moncler outlet
air max
air max 90
hermes outlet
dolce and gabbana
simulation shoes
pandora charms
moncler jackets
michael kors outlet
chrome hearts outlet
ray ban sunglasses
pandora charms
calvin klein jeans
pandora charms
michael kors outlet
harry winston jewelry
miu miu handbags
coach handbags
ralph lauren polo shirts
bcbg dresses
uggs outlet
canada goose outlet
coach outlet
ralph lauren polo shirts
nfl jersey wholesale
pandora jewelry
ugg outlet
converse shoes
canada goose jackets
adidas outlet
oakley sunglasses
nike store
denver broncos jerseys
undefeated clothing
christian louboutin outlet
christian louboutin shoes
uggs outlet
michael kors outlet
ferragamo outlet
coach outlet store online
ray ban sunglasses
michael kors
kate spade outlet
marc jacobs outlet
coach canada
mbt shoes
christian louboutin outlet
ugg outlet
coach outlet online
christian louboutin outlet
fitflops outlet
denver broncos jerseys
canada goose jackets
michael kors outlet
canada goose outlet
bape clothing
moncler outlet
air jordan retro
asics shoes
san francisco 49ers jerseys
air jordan 4
ray ban sunglasses
prada handbags
longchamp outlet
canada goose coats
visvim shoes
fingerlings monkey
canada goose jackets
air max 97
canada goose coats
tory burch outlet
polo ralph lauren
pandora charms
longchamp handbags
grizzlies jerseys
michael kors outlet
canada goose outlet
mac makeup
adidas uk
scarpe mbt
pelicans jerseys
canada goose jackets
audemars piguet watches
vans shoes
manolo blahnik outlet
canada goose jackets
coach outlet
camel shoes
coach outlet
pandora jewelry
nike store
polo ralph lauren
uggs outlet
nike lunarglide
christian louboutin shoes
fitflops
nhl jerseys
coach outlet
tory burch outlet
ferragamo outlet
christian louboutin outlet
supreme clothing
ugg outlet
ferragamo outlet
swarovski outlet
gucci outlet
pandora charms sale clearance
michael kors outlet online
coach factory outlet
lacoste soldes
louboutin pas cher
polo ralph lauren
christian louboutin outlet
coach outlet online
cheap mlb jerseys
coach outlet online
true religion jeans
cheap jordans
givenchy handbags
gucci outlet
mbt shoes
ugg outlets
burberry outlet
cheap jordans
nike shoes
herve leger outlet
ugg boots clearance
ugg boots
coach outlet
ray ban sunglasses
ugg boots clearance
ugg outlet
air force 1
huf clothing
toms shoes
cheap nfl jerseys
san antonio spurs jerseys
chelsea jersey
red bottom shoes
canada goose jackets
mulberry handbags
fitflops sale
pandora outlet
stephen curry shoes
longchamp outlet
jordan shoes
longchamp handbags
christian louboutin outlet
coach outlet
coach outlet
heat jerseys
air max 90
christian louboutin shoes
dsquared2 jeans
bulgari jewelry
christian louboutin outlet
van cleef & arpels jewelry
ugg boots
chloe sunglassess
ugg outlet
balmain jeans
uggs outlet
ugg outlet
longchamp handbags
knicks jerseys
longchamp pas cher
canada goose jackets
hornets jerseys
adidas nmd
oakley sunglasses
jeep shoes
oakley sunglasses
mulberry bags
true religion jeans
nike air max
polo ralph lauren
houston texans jerseys
lacoste polo shirts
air max 1
bally shoes
air max 90
coach outlet online
canada goose outlet
canada goose outlet
jordan shoes
ugg outlet 
brequet wathes
ray ban sunglasses
kevin durant shoes
nike pegasus
pandora charms
oakley sunglasses
michael kors handbags
louboutin shoes
g-star jeans
adidas wings
tory burch outlet
fossil watches
tory burch outlet
canada goose outlet
trailblazers jerseys
cheap jordans
montblanc pens
kobe bryant shoes
yeezy boost
oakley sunglasses
barbour jackets
freshjive clothing
arcteryx jacket
guess factory
raptors jerseys
dansko shoes
hermes belt
coach outlet online
hermes birkin
fitflops sale clearance
nobis outlet
coach outlet
nike shoes
fred perry polo shirts
lakers jerseys
michael kors outlet
nike factory outlet
cleveland cavaliers jersey
polo outlet
dior outlet
ugg outlet
mulberry handbags
timberwolves jerseys
pandora
coach outlet
moncler jackets
polo outlet
air max 2017
nba jerseys
ugg outlet
mbt shoes
oakley sunglasses
cartier jewelry
chicago blackhawks jerseys
five fingers shoes
nike roshe one
thunder jerseys
tory burch outlet
mulberry outlet
michael kors
polo ralph lauren
belstaff jackets
nets jerseys
coach outlet
tory burch outlet
air max 90
lebron james shoes
keen shoes
michael kors handbags
uggs outlet
manchester united jersey
burberry outlet
kate spade outlet
adidas outlet
nike outlet
bvlgari jewelry
magic jerseys
adidas nmd
minnetonka outlet
kate spade outlet
adidas soccer shoes
salomon shoes
kate spade outlet
canada goose jackets
baltimore ravens jerseys
michael kors outlet
michael kors
lakers jerseys
yeezy boost 350
nba jerseys
canada goose outlet
nike revolution
fitflops sale clearance
prada sunglasses
yeezy boost
basketball shoes
air huarache
world cup jerseys
isabel marant shoes
light up shoes
fitflops
kate spade outlet
futbol baratas
ray ban sunglasses
coach outlet
moncler outlet
nike shoes
ralph lauren outlet
kate spade outlet
michael kors outlet
chrome hearts sunglasses
jordan shoes
kobe 9
pistons jerseys
pandora charms
coach outlet online
coach handbags
toms shoes
polo ralph lauren
soccer jerseys
kappa clothing
tag heuer watches
christian louboutin outlet
swarovski crystal
nike dunks
canada goose outlet
coach outlet
swarovski crystal
canada goose outlet
ralph lauren polo
michael kors outlet clearance
coach outlet
michael kors handbags
michael kors outlet
true religion jeans
supreme clothing
jordan shoes
cheap jordans
air more uptempo
fendi handbags
coach outlet online
coach outlet online
true religion jeans
coach outlet
longchamp handbags
nba jerseys
tods outlet
red bottom shoes
kate spade outlet
cheap jordans
coach outlet
kevin durant shoes
nike store uk
kate spade outlet
a bathing ape
true religion uk
jordan shoes
le coq sportif shoes
cheap jordans
longchamp solde
true religion jeans
true religion jeans
toms shoes
ugg outlet
kings jerseys
pacers jerseys
air jordan 3
spurs jerseys
tory burch outlet
prada shoes
balenciaga sneakers
coach outlet
james harden jerseys
longchamp pliage
coach outlet
coach outlet
north face jackets
michael kors outlet
ugg outlet
michael kors outlet
michael kors outlet
polo shirts
nike foamposite
polo outlet
michael kors outlet
ralph lauren pas cher
kd 10 elite
michael kors
jordan shoes
adidas ultra boost
nike tennis
canada goose jackets
polo ralph lauren
michael kors outlet clearance
kate spade outlet
adidas crazy
rockets jerseys
puma outlet
bucks jerseys
suicoke sandals
moncler outlet
mulberry outlet
reebok trainers
cheap jerseys
red bottom shoes
ugg boots
air max 97
pandora jewelry
gentle monster sunglasses
moncler outlet
mcm outlet
coach outlet
pandora charms
y3 shoes
polo ralph lauren
cheap jordans
swarovski outlet
christian louboutin outlet
jordan shoes
michael kors handbags
76ers jerseys
ugg boots
canada goose outlet
oakley sunglasses
balenciaga sneakers
mulberry handbags
ferragamo shoes
michael kors outlet
saucony shoes
off-white
canada goose jackets
canada goose parka
ugg boots
pandora charms
oakley sunglasses
kobe shoes
oakley sunglasses
nike outlet
jimmy choo sunglasses
canada goose jackets
ferragamo shoes
ray ban sunglasses
uggs outlet
dc shoes
true religion outlet
real madrid jersey
ugg outlet 
mulberry bags
red bottom shoes
michael kors outlet
jimmy choo shoes
ray ban sunglasses
chrome hearts outlet
cheap jordans
under armour outlet
alife clothing
michael kors
oakley sunglasses
ferragamo outlet
giuseppe zanotti outlet
michael kors outlet
canada goose outlet
michael kors handbags
true religion outlet
coach outlet
cheap mlb jerseys
air jordan shoes
christian louboutin outlet
ralph lauren polo shirts
diesel jeans
nike free
champion clothing
coach outlet online
cheap jerseys
kyrie 4
canada goose outlet
michael kors outlet
kevin durant jerseys
canada goose outlet
kate spade outlet
ray ban outlet
birkenstock outlet
nike air force 1
ray ban sunglasses
cheap jordans
cheap football shirts
true religion jeans
canada goose outlet
canada goose outlet
swarovski outlet
wizards jerseys
coach outlet online
ugg outlet
malone souliers mules
canada goose outlet
cheap jordans
basketball jerseys
wellensteyn jackets
longchamp solde
palladium boots
mulberry sale
north face jackets
10 deep clothing
true religion jeans
coach outlet
coach outlet
oakley sunglasses
cheap jordans
gucci outlet
nike cortez
stuart weitzman shoes
supreme clothing
ray ban sunglasses
true religion jeans
coach outlet
chopard jewelry
off white
christian louboutin outlet
polo ralph lauren
indianapolis colts jerseys
uggs outlet
columbia sportswear
adidas trainers
jazz jerseys
supra shoes
ugg boots
kd 9
suns jerseys
michael kors outlet
ugg outlet
warriors jerseys
ed hardy clothing
nuggets jerseys
nike presto
christian louboutin outlet
coach factory outlet
polo outlet
ugg outlet
nike roshe
ralph lauren pas cher
pandora charms
michael kors outlet
michael kors outlet online
pandora outlet
ralph lauren shirts
birkenstock sandals
ugg outlet
michael kors outlet
armani exchange
coach outlet
polo outlet
christian louboutin outlet
kate spade outlet
air huarache
ubiq shoes
tory burch outlet
canada goose jackets
hermes outlet
football shirts
michael kors outlet
celtics jerseys
coach factory outlet
new balance shoes
jack wolfskin
nike air max 2015
coach outlet
celine outlet
north face jackets
mavericks jerseys
mizuno running shoes
nfl jerseys wholesale
uggs outlet
polo ralph lauren
cheap nhl jerseys
true religion jeans
ferragamo outlet
valentino outlet
michael kors outlet
stussy clothing
ugg boots clearance
ugg boots
michael kors outlet
michael kors outlet
air max 95
clippers jerseys
canada goose outlet
true religion outlet
polo ralph lauren
air jordan shoes
air jordan release dates
clarks shoes
mont blanc pens
oakley sunglasses
air max uk
nike air max 90

отвечен 06:03, 29.08.2018
ava 


Зарегистрируйтесь или войдите, чтобы написать.
Фирма дня
Вы также можете добавить свою фирму в каталог IT-фирм, и публиковать статьи, новости, вакансии и другую информацию от имени фирмы.
Подробнее
Участники
advanced
Отправить