Tim,
Not 100% clear on your data model.
You've got a table of Speakers. But if a Speaker can speak in more than
one time slot, then it's not really a (normalised) Speakers table,
because one of its columns is time_slot. So it's more of a
SpeakerInTimeSlot table.
Do you want a result set which contains only one row for each speaker?
If so, and there are many rows in the table for each speaker, which
time slot do you want to be in the result set?
Nick
-----Original Message-----
From: Tim Bahlke [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 20, 2000 10:01 PM
To: [EMAIL PROTECTED]
Subject: SP and Distinct [CF-Talk]
I want to pull data from a db where the l_name fields are distinct. I have
created the SP below. Obviously, I am not much of a SQL person.
The Distinct keyword in being applied for the whole select statement, which
would be fine if not for 'a.time_slot'. Is there a way to limit the distinct
just for l_name in the SP below?
SELECT DISTINCT s.f_name, s.l_name, s.pro_title, c.co_name, sm.subject,
a.agenda_title, s.sp_file, a.time_slot
FROM speakers s, company c, subject_matter sm, agenda a
WHERE a.time_slot = s.time_slot
AND s.subject_id = sm.subject_id
AND s.company_id = c.company_id
AND s.sp_file is not null
ORDER BY s.f_name, s.l_name
Thanks,
Tim Bahlke
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
**********************************************************************
Information in this email is confidential and may be privileged.
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system.
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone.
Thank you for your co-operation.
**********************************************************************
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.