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
 Project: Hit brick wall

Author  Topic 

slapper
Starting Member

6 Posts

Posted - 2008-03-15 : 03:38:01
To ask my question i will create an example.
Table STAFF contains FIRSTNAME and LASTNAME and STAFF_ID.
Table CLASS contains TIME and STAFF_ID

Q: How do i perform a search on CLASS for a specific TIME, and display contents from STAFF, contents being FIRSTNAME AND LASTNAME only. Is it possible since both tables have STAFF_ID in common.

slapper
Starting Member

6 Posts

Posted - 2008-03-15 : 04:00:55
The below statement is what im trying to execute but its error probed for a reason, surely what im trying to do is possible.

select FIRSTNAME, LASTNAME from staff where STAFF_ID = STAFF_ID from class where TIME = 'value'

Go to Top of Page

slapper
Starting Member

6 Posts

Posted - 2008-03-15 : 04:36:57
INGORE THIS POST

I figured it out through trial and error
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-03-15 : 05:13:35
quote:
Originally posted by slapper

INGORE THIS POST

I figured it out through trial and error


What is the solution?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

slapper
Starting Member

6 Posts

Posted - 2008-03-15 : 07:20:28
Ah was very simple, but im all new to this, all i did was
select staff.firstname, staff.lastname from staff, class,
where class.time = 'create a value' and staff.staff_id = class.staff_id
Go to Top of Page
   

- Advertisement -