Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I need to combine the details of two tables and narrow the data included. in my tutor table i havetutorLastName, tutorSessions and tutorSkillsin my term table i haveweek, date, session_Name, tutorNamei need to combine the tales to show:(from the term table) week, date,session_Name, tutorName,(from the tutor table) tutorSkills.i then need to narrow the table down so it shows only tutors with guitar skills and the term dats when the session_name is emptyi can run the two searches sepereately but cannot combine them i am tryin to use Where date = "whateverdate" AND session_name is nullAND tutorSkills = guitar please help and tell me where im going wrong
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts
Posted - 2008-04-23 : 11:16:45
Any sample data?Ryan Randall Solutions are easy. Understanding the problem, now, that's the hard part.
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2008-04-23 : 12:29:37
May be this:-
SELECT t.tutorSkills,tr.week, tr.date,tr.session_Name, tr.tutorNameFROM tutor tINNER JOIN term trON tr.tutorName=t.tutorLastNameAND t.tutorSkills='guitar'WHERE tr.date=yourdateAND tr.session_Name IS NULL
If its not getting you desired o/p,plzz post some sample data and o/p you look for.