简体   繁体   中英

Relationship between two tables in SQL Server

I have two tables in LibraryDB. One is Book_Master and the other is Languages. I have used langid in Book_Master as a Foreign Key and want to make a relationship between these two tables but I've got an error. Picture is given in the description. Help me Programmers..!! Here is the picture Click to see image

Analyze your tables.

select b.LangID
from book_master b
left join Languages L on b.LangID = L.LangID
where L.LangID is null

The result is LangID's in Book_master which don't exist in Languages (and block FK creation).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM