Olá pessoal, estou usando a clausula group by no sql server 2000
com o codigo abaixo, e ta dando erro, ue será?
<%
strSQl = "SELECT * FROM cifras where autor='" & Request.QueryString("autor") & "' group by autor"
Set Rs_cifras2 = server.createobject("ADODB.Recordset")
Rs_cifras2.Open strSQl,Conn , 3, 3
total= Rs_cifras2.recordcount
linha = "4" ' Numero de imagens por linha
%>
O erro é:
Tipo de erro:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][sql Server]Column 'cifras.id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
/host/viveasp/portal/clube/cifras_conteudo_con_autor_musica.asp, line 29
Question
Carlos Rocha
Olá pessoal, estou usando a clausula group by no sql server 2000
com o codigo abaixo, e ta dando erro, ue será?
<%
strSQl = "SELECT * FROM cifras where autor='" & Request.QueryString("autor") & "' group by autor"
Set Rs_cifras2 = server.createobject("ADODB.Recordset")
Rs_cifras2.Open strSQl,Conn , 3, 3
total= Rs_cifras2.recordcount
linha = "4" ' Numero de imagens por linha
%>
O erro é:
Tipo de erro:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][sql Server]Column 'cifras.id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
/host/viveasp/portal/clube/cifras_conteudo_con_autor_musica.asp, line 29
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.