Forums
This topic is locked
SELECT DISTINCT
Posted 06 Feb 2005 08:06:16
1
has voted
06 Feb 2005 08:06:16 Jaime Romo posted:
hello there i need help with this....i have a dinamic list menu that recibes data froma clumn but maybe that colum will have duplicated values and if there are duplicated values i need that the list menu only display's one
im using Select Distinct but i the menu still recibes duplicated values..... how can i make it work????
this is the code
thanks for your help
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_avayaBanners_STRING
Recordset1.Source = "SELECT DISTINCT * FROM conteo"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<b></b><b></b><b></b><font color=blue></font id=blue>
Visit my home page
www.cancuncoral.com
Replies
Replied 06 Feb 2005 12:06:25
06 Feb 2005 12:06:25 Chris Charlton replied:
Hmm, what does your dynamic menu looks like (the data, not the HTML/dynamic code)?
Since there are duplicates, and you are already trying SELECT DISTINCT, then maybe you should look into the GROUP BY clause. There's a DMXzone premium article that covers scenarios of both DISTINCT and GROUP BY: www.dmxzone.com/showDetail.asp?TypeId=28&NewsId=6782
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Since there are duplicates, and you are already trying SELECT DISTINCT, then maybe you should look into the GROUP BY clause. There's a DMXzone premium article that covers scenarios of both DISTINCT and GROUP BY: www.dmxzone.com/showDetail.asp?TypeId=28&NewsId=6782
~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>