macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: combine queries

Subject: Re: combine queries
From: "BKBK"
Date: Wed, 8 Aug 2007 19:39:04 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
Splitzer wrote:
 [i]unique column is "id" ... I did mention that colum "myID" is NOT unique. 
[/i]

 OK. I combed back and found it. 

 You yourself have spelt it out in detail. Doesn't this do it? 

 <cfquery name="uniqueQuery" dbtype="query">
 SELECT *
 FROM notes_get, favorite_sites
 /* filter results from Table 1, id = 2 */
 WHERE notes_get.id = 2
 /* TABLE 2: ... filter column "myID" = 2 */
 AND favorite_sites.myID = 2
 /* TABLE 2: ... plus sort the results by "date" ORDER BY date DESC  */
 ORDER BY favorite_sites.date DESC
 </cfquery>




<Prev in Thread] Current Thread [Next in Thread>