It might make more sense to you if you think about it as two completely 
separate queries...

<cfquery name="q1"...>
SELECT n_r_id FROM notes_to_the_record_shared WHERE id =
#session.user.id#
</cfquery>

The above query just got us a list of n_r_id's that we know are 
associated with the user.
Convert that to a list...

<cfset idlist = valuelist(q1.n_r_id)>

Then do the second query...

<cfquery name="q2"...>
SELECT n.meeting_name,n.type,n.note_date,n.notes,n.type_describe
FROM notes_to_the_record n
WHERE n.ID = #session.user.id#
OR
n.n_r_id IN (#idlist#)
</cfquery>

The IN just compares a column to a list of values...it does not create a 
JOIN...in fact, as you can see above, it doesn't even need to know about 
the second table.  Using the subquery is just a way to get that list of 
values.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267961
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to