sql的嵌入式查询主要用于多个数据库表的交集查询!
sql="select * from main where m_pass='1'" sql =sql&"AND sellname like '%"&keyword&"%'" sql=sql&" AND mytype like '%"&mytype1&"%' " sql=sql&" AND selltype like '%"&selltype1&"%' " sql=sql&" AND remark like '%"&keyword&"%'" if StrComp(nclassid1,"") then ' response.write "1 anclassid1="&nclassid1&" " sql=sql&" AND anclassid like '%"&anclassid1&"%' " else'不相等 -1 1 sql=sql&" OR anclassid in (select anclassid from shop_anclass where anclass like '%"&keyword&"%')" end if if StrComp(nclassid1,"") then ' response.write "1 nclassid1="&nclassid1&" " sql=sql&" AND nclassid like '%"&nclassid1&"%' " else sql=sql&" OR nclassid in (select nclassid from shop_nclass where nclass like '%"&keyword&"%')" end if if StrComp(classid1,"") then ' response.write "1 classid1="&classid1&" " sql=sql&" AND classid like '%"&classid1&"%' " else sql=sql&" OR classid in (select classid from shop_class where class like '%"&keyword&"%')" end if
sql=sql&" order by id desc"
|
阅读(1557) | 评论(0) | 转发(0) |