"select * from product where classid="&classid&" order by case when classid="&classid&" then 0 else 1 end,classid"我这样写的对吗 输出没结果
我这样写的对吗? 输出没结果"select * from product where classid="&classid&" order by case when classid="&classid&" then 0 else 1 end,classid"
declare @参数 nvarchar(20) exec ('select * from product where classid='+@参数+' order by case when classid='+@参数+' then 0 else 1 end,classid')
order by case when id=20 then 1 else 2 end,id
ASP开发 我按照你写的也是没有输出。可能是我太笨了 <% classid = request("classid") set rsx=server.createobject("adodb.recordset") sqlx="select * from product where classid='&classid&' order by case when classid='&classid&' then 0 else 1 end,classid" rsx.open sqlx,conn,1,1 if not rsx.eof then %>
我是ASP语言 我写的对吗,没有输出 <% classid = request("classid") set rsx=server.createobject("adodb.recordset") sqlx="select * from product where classid="&classid&" order by case when classid="&classid&" then 1 else 2 end,classid" rsx.open sqlx,conn,1,1 if not rsx.eof then %>
我这样写的对吗? 输出没结果"select * from product where classid="&classid&" order by case when classid="&classid&" then 0 else 1 end,classid"
exec ('select * from product where classid='+@参数+' order by case when classid='+@参数+' then 0 else 1 end,classid')
ASP开发 我按照你写的也是没有输出。可能是我太笨了
<%
classid = request("classid")
set rsx=server.createobject("adodb.recordset")
sqlx="select * from product where classid='&classid&' order by case when classid='&classid&' then 0 else 1 end,classid"
rsx.open sqlx,conn,1,1
if not rsx.eof then
%>
我是ASP语言 我写的对吗,没有输出 <%
classid = request("classid")
set rsx=server.createobject("adodb.recordset")
sqlx="select * from product where classid="&classid&" order by case when classid="&classid&" then 1 else 2 end,classid"
rsx.open sqlx,conn,1,1
if not rsx.eof then
%>
如果是这样怎么写 输出产品Id=20的在前面显示 其他则按照ID大小在后面显示 但是后面显示不要包括ID=20的产品了
如果是这样怎么写 输出产品Id=20的在前面显示 其他则按照ID大小在后面显示 但是后面显示不要包括ID=20的产品了
不是显示一次 是显示在前 然后在显示出其他的ID的产品 按照ID排序
select * from xxx where id=20
union all
select *
from xxx