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 |
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2008-07-11 : 14:14:19
|
| I have a web page for a user to categorized titles in the database to go with a classification. When they select a title they next have to select classifications that go with the titles (such classifictions are Management, Quality, etc...). Those results go in the Titleclassification table.Now the user wants a report on all of the titles that do not have a classification to see if they classified all of the titles.How do I do this? Here's the table and field structure:Table Name - TitlesField- TitleIDField - TitleTable Name - ClassificationsField - ClassificationIDField - DescriptionTable Name - TitleclassificationField - TitleClassIDField - ClassificationIDField - TitleIDTried this but it’s not giving me the right data back.select titleclassification.titleid, titleclassification.classificationidfrom titleclassificationinner join titles on titles.titleid = titleclassification.titleidwhere titles.titleid <> titleclassification.classificationidThanks. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-11 : 15:32:08
|
| try thisselect ti.titleid, tc.classificationidfrom titles tileft join titleclassification tcon ti.titleid = tc.titleidwhere tc.classificationID is nullJim |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-12 : 02:03:05
|
| select titleidfrom titles where titleid not in (select titleid from titleclassification) |
 |
|
|
|
|
|