asp 一条命令 sql="select distinct c,count(c) as cc from fache.....
sql="selectdistinctc,count(c)asccfromfachewherealike'%"&ss&"%'groupbyc"c是一个字段这条命令上是固定...
sql="select distinct c,count(c) as cc from fache where a like '%"&ss&"%' group by c"
c是一个字段 这条命令上是固定的字段 就是c 我想在前页搜索的表单中增加一个表单 就是让c也可以自己选择字段 比如输入d 那就是select distinct(d),count(d)as cc ....输入e就是select distinct(e),count(e)as cc ....
提交页面 <input type="text" name="zzz" id="zzz">
此页面 <%zzz=request("zzz")%>
...sql="select distinct ___,count(___) as cc from fache where a like '%"&ss&"%' group by ___"
填空...该怎么写?
错误代码如下:
This page contains the following errors:
error on line 1 at column 16: AttValue: " or ' expectederror on line 1 at column 16: Encoding error
Below is a rendering of the page up to the first error.
页面源代码:
...
if action="1" then
sql="select distinct " & zzz & ",count(" & zzz & "') as cc from fache where a like '%"&ss&"%' group by " & zzz
elseif action="2" then
... 展开
c是一个字段 这条命令上是固定的字段 就是c 我想在前页搜索的表单中增加一个表单 就是让c也可以自己选择字段 比如输入d 那就是select distinct(d),count(d)as cc ....输入e就是select distinct(e),count(e)as cc ....
提交页面 <input type="text" name="zzz" id="zzz">
此页面 <%zzz=request("zzz")%>
...sql="select distinct ___,count(___) as cc from fache where a like '%"&ss&"%' group by ___"
填空...该怎么写?
错误代码如下:
This page contains the following errors:
error on line 1 at column 16: AttValue: " or ' expectederror on line 1 at column 16: Encoding error
Below is a rendering of the page up to the first error.
页面源代码:
...
if action="1" then
sql="select distinct " & zzz & ",count(" & zzz & "') as cc from fache where a like '%"&ss&"%' group by " & zzz
elseif action="2" then
... 展开
3个回答
展开全部
by 字段名
如果你想上一页选择,那你传过来的值直接用字段名就可以了。
比如,ZZZ传过来的是C,那就相当于你原来的写法了。
zzz=request("zzz")
sql="select distinct c,count(c) as cc from fache where a like '%"&ss&"%' group by "&zzz
你要C,全部用变量值 啊。。
sql="select distinct “&zzz&",count(“&zzz&") as cc from fache where a like '%"&ss&"%' group by "&zzz
复制的话注意看空格和字符,,我这里打,不怎么看得出的。
如果你想上一页选择,那你传过来的值直接用字段名就可以了。
比如,ZZZ传过来的是C,那就相当于你原来的写法了。
zzz=request("zzz")
sql="select distinct c,count(c) as cc from fache where a like '%"&ss&"%' group by "&zzz
你要C,全部用变量值 啊。。
sql="select distinct “&zzz&",count(“&zzz&") as cc from fache where a like '%"&ss&"%' group by "&zzz
复制的话注意看空格和字符,,我这里打,不怎么看得出的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
应该是这样的,
sql="select distinct " & zzz & ", count( " & zzz &" ) as cc from fache where a like '%"& ss &"%' group by " & zzz
你的错误 改成 ,注意 count 括号中 你多了个单引号,我下面帮你去掉
...
if action="1" then
sql="select distinct " & zzz & ",count(" & zzz & " ) as cc from fache where a like '%"&ss&"%' group by " & zzz
elseif action="2" then
sql="select distinct " & zzz & ", count( " & zzz &" ) as cc from fache where a like '%"& ss &"%' group by " & zzz
你的错误 改成 ,注意 count 括号中 你多了个单引号,我下面帮你去掉
...
if action="1" then
sql="select distinct " & zzz & ",count(" & zzz & " ) as cc from fache where a like '%"&ss&"%' group by " & zzz
elseif action="2" then
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-03-29
展开全部
就你提供的代码 可以检查出来 count("&zzz&") 多个单引号,去掉试试
或者你把错误页的全部代码黏贴出来,否则不能找出错误位置
或者你把错误页的全部代码黏贴出来,否则不能找出错误位置
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询