[thelist] Query Help
Ken Schaefer
Ken at adOpenStatic.com
Thu Jan 5 18:34:02 CST 2006
-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Casey
Sent: Friday, 6 January 2006 5:07 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] Query Help
Chris Wrote:
>> The DISTINCT clause will be satisfied when the values of all fields listed
>> in the SELECT statement *combined* are unique. Thus the following will
>> return a list of all event ids, each being represented once.
>>
>> SELECT DISTINCT events_banquets.event_id
>> WHERE events_banquets.event_id = events_banquets_staff.event_id
>> AND events_banquets_staff.userID = '" & userID & "' "
>
>Thanks Chris.... but, can you use a table in the WHERE clause when you
>didn't use it in the SELECT?
Of course you can:
SELECT
a.SomeField
FROM
Table1 AS a
INNER JOIN
Table2 AS b
ON
a.FK = b.ID
WHERE
b.ID = 1
Cheers
Ken
More information about the thelist
mailing list