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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Combining table details

Author  Topic 

sambrown18
Starting Member

14 Posts

Posted - 2008-04-23 : 11:11:56
I need to combine the details of two tables and narrow the data included.

in my tutor table i have

tutorLastName, tutorSessions and tutorSkills

in my term table i have

week, date, session_Name, tutorName

i 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 empty

i can run the two searches sepereately but cannot combine them i am tryin to use Where date = "whateverdate" AND session_name is null
AND 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.
Go to Top of Page

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.tutorName
FROM tutor t
INNER JOIN term tr
ON tr.tutorName=t.tutorLastName
AND t.tutorSkills='guitar'
WHERE tr.date=yourdate
AND tr.session_Name IS NULL


If its not getting you desired o/p,plzz post some sample data and o/p you look for.
Go to Top of Page
   

- Advertisement -