Hello everybody,

I was wondering if someone could help me. I am trying to get the distinct record from 
a select statment. Here is the code.

<cfquery name="getEmployeeDetails" datasource="db">
select distinct reference, uniqueID, firstname, lastname
FROM employee
WHERE reference = 'cfcoder'
ORDER BY reference asc
</cfquery>

This brings back 2 records, and I want it to only return 1 row. 

<select name="custname" id="custname"> 
<cfloop query="getEmployeeDetails">
<option value="#reference#">#reference#</option>
</cfloop>
</select>

The data in the table looks like this

1       cfcoder         cf              coder
2       CFCODEr         cf              coder

There are two rows in the table with the same reference. How do I get it to only 
display 1 record. Can somebody please help

Regards
cfcoder

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=37

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:181978
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to