asp 中 order by 问题

来源:百度知道 编辑:UC知道 时间:2024/06/10 17:18:29
sSql = "select * from View_ProductPic where PIP_bBigFlag=1 and PI_iType=" & PI_iType & sSearchCondition
上面是一个sql语句,现在想加上order by PIP_sort
下面我这样写是错误的.请问怎样写才对呢?
sSql = "select * from View_ProductPic where PIP_bBigFlag=1 and PI_iType=" & PI_iType & sSearchCondition order by PIP_sort

sSql = "select * from View_ProductPic where PIP_bBigFlag=1 and PI_iType=" & PI_iType & sSearchCondition&" order by PIP_sort" 一楼不知道请不要乱说.

你须要加“ &" ”后才能在加你的那句,而且在你的那句以后还要加“ " ”。

sSql = "select * from View_ProductPic where PIP_bBigFlag=1 and PI_iType=" & PI_iType & sSearchCondition
sSql=sSql&" order by PIP_sort"

提问者的问题有点问题哟?首先你的 PI_iType是什么数据类型, sSearchCondition 又是什么数据类型,还有PIP_sort 又是什么数据类型,
先不说PIP_sort 这个,先说前面的那个条件.不同的数据类型有不同的写法.有加有这样加的'"&&' 也有这样加的"&&" .还有'' 你自己都不清楚.别人也不知道怎么回答你.