Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2014-01-13 : 06:29:32
|
i want to check which records(bldg.rmtitle based) are wrong records or not found in table_rm, between table_bldg and table_rmtablerm is master table, this table has projid int columntable_BLDG (projno, rmtitle, bldgno, bin_no) using projno need to get table_project.projid, this projid column(int) is in rm master table.i am really confused how to query just to get all rows from table_bldg which rmtitle is not found in table_rm.***************************************select proj.projid, bldg.projno, bldg.rmtitle, bldg.bldgno, bldg.bin_no from table_bldg bldginner join table_project proj on(bldg.projno = proj.projno)inner join table_rm rm on(proj.projid = rm.projid and bldg.rmtitle not in table_rm table)*******************************Thanks a lot for the helpful info. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-01-13 : 07:35:24
|
[code]select *from table_bldg bldg inner join table_project proj on bldg.projno = proj.projnowhere not exists ( select * from table_rm rm where rm.projid = proj.projid and rm.rmtitle = bldg.rmtitle )[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|