Help! This should be simple. Have I found a bug in Queries of Queries?
I have two queries to the database. Later I want to join the data and sort it by an
INTEGER column called 'SEQ'. I use a query of a query to do the select in memory, but
I get the following error:
GETTHESE.SEQ is not a column that can be sorted on.
Here is the relevant code:
Tests for bug in query of query
Database:
Table This ( (ONE of This)
ThisID int
ThisName varchar(50)
)
Table These ( (to MANY of These)
TheseID int
TheseName varchar(50)
ThisID int (foreign key to This.ThisID)
SEQ int (Sequence for sorting)
)
================
<cfquery name="getThis" datasource="demo">
select ThisID, ThisName from This
where ThisID=1
</cfquery>
<cfquery name="getThese" datasource="demo">
select TheseID, ThisID, SEQ, TheseName from These
</cfquery>
<cfquery name="getSortedJoin" dbtype="query">
select ThisID, TheseID from getThis, getThese
where getThis.ThisID = getThese.ThisID
order by getThese.SEQ
</cfquery>
<cfoutput query="getSortedJoin">
#ThisID#, #TheseID#<br>
</cfoutput>
______________________________________________________________________
Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists