Small error: ORDER BY Total DESC !!!

-----Original Message-----
From: Pascal Peters 
Sent: vrijdag 11 januari 2002 16:14
To: CF-Talk
Subject: RE: When Comparing two tables how do I.....


FOR SQL-Server:

<CFQUERY NAME="NameMe" DATASOURCE="SomeDNS" maxrows="10">
    SELECT LastName, FirstName, Beard1+Beard2+Beard3+Beard4 AS Total,
HarvestCounty 
    FROM Table1
    Union
    SELECT LastName, FirstName, Beard1+Beard2+Beard3+Beard4 AS Total,
HarvestCounty
    FROM Table2
    ORDER BY Total
</CFQUERY>

-----Original Message-----
From: Jay Callaghan [mailto:[EMAIL PROTECTED]]
Sent: vrijdag 11 januari 2002 15:30
To: CF-Talk
Subject: When Comparing two tables how do I.....


Ok, I got the Union thing down pat and working 100%. Now I got 4 columns
with "related" information that needs to be added together, then display
the
Top 10.

To summarize what i am wanting to do. I got 2 tables with the same field
types/names. I want to be able to connect to the two, add up the 4
fields of
information then list the Top 10 TOTALS from the 2 tables combined.

Any ideas.

I got the joining part down, thanx to this newsgroup :)

<CFQUERY NAME="NameMe" DATASOURCE="SomeDNS">
    SELECT LastName, FirstName, Beard1, Beard2, Beard3, Beard4,
HarvestCounty
    FROM Table1
    Union
    SELECT LastName, FirstName, Beard1, Beard2, Beard3, Beard4,
HarvestCounty
    FROM Table2
</CFQUERY>



______________________________________________________________________
Why Share?
  Dedicated Win 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=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to