If you are doing a join across the tables:

<CFQUERY NAME="links" DATASOURCE="biobroker">
SELECT  distinct(busPlan.*) busPlan.*, entreProfile.*
FROM busPlan, entreProfile
WHERE status LIKE "new"
  AND busPlan.<somefield> = entreProfile.<somefield>
</CFQUERY>
If you are not doing a join, you need to take a step back further and union
2 query results.



Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes
[EMAIL PROTECTED]


  -----Original Message-----
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Arun Persaud
  Sent: Monday, April 08, 2002 11:25 AM
  To: [EMAIL PROTECTED]
  Subject: [CFTALKTor] Pulling a Distinct Value from one of two tables


  Has anyone pulled data from one of two tables using "DISTINCT" ?

  I've done it on one table:

  <CFQUERY NAME="statusNew" DATASOURCE="databasename">
  SELECT COUNT(DISTINCT profileID) AS new
  FROM busPlan
  WHERE status LIKE "new"
  </CFQUERY>

  But I'd like to pull the DISTINCT value from the table "busPlan" only and
not "entreProfile" table.

  <CFQUERY NAME="links" DATASOURCE="biobroker">
  SELECT  busPlan.*, entreProfile.*
  FROM busPlan, entreProfile
  WHERE status LIKE "new"
  </CFQUERY>

  I just can't figure out the correct syntax.

  Thank you for any assistance out there.

  Arun Persaud
  [EMAIL PROTECTED]

<<attachment: winmail.dat>>

Reply via email to