asp程序之中的三个SQL语句怎么解释啊
我想知道他们各个怎么理解,好复杂,理不清:<%dimpsize,i,pagestj=""(**这个是什么意思?)sql="select*,round(count3/cou...
我想知道他们各个怎么理解,好复杂,理不清:
<%
dim psize,i,pages
tj = "" (**这个是什么意思?)
sql = "select *,round(count3/counts*100,2) as c1,round(count4/counts*100,2) as c2 from (select id,name,sum(cou0) as count0,sum(cou1) as count1,sum(cou2) as count2,sum(cou3) as count3,sum(cou4) as count4,sum(cou5) as count5,sum(cou0+cou1+cou2+cou3+cou4+cou5) as counts"
sql = sql &" from (select a.id,a.name,iif(b.selectTT=0,b.cou,0) as cou0,iif(b.selectTT=1,b.cou,0) as cou1,iif(b.selectTT=2,b.cou,0) as cou2,iif(b.selectTT=3,b.cou,0) as cou3,iif(b.selectTT=4,b.cou,0) as cou4,iif(b.selectTT=5,b.cou,0) as cou5"
sql = sql &" from member a left join (select memberID,selectTT,count(1) as cou from DATE2010 "
if request("start")<>"" then
……
iif(b.selectTT=0,b.cou,0) as cou0 是什么意思?
sql = sql &" 是什么意思,怎么使用?
三个SQL语句是什么关系?
sql &" from member a left join (select memberID,selectTT,count(1) as cou 又是怎么理解? 展开
<%
dim psize,i,pages
tj = "" (**这个是什么意思?)
sql = "select *,round(count3/counts*100,2) as c1,round(count4/counts*100,2) as c2 from (select id,name,sum(cou0) as count0,sum(cou1) as count1,sum(cou2) as count2,sum(cou3) as count3,sum(cou4) as count4,sum(cou5) as count5,sum(cou0+cou1+cou2+cou3+cou4+cou5) as counts"
sql = sql &" from (select a.id,a.name,iif(b.selectTT=0,b.cou,0) as cou0,iif(b.selectTT=1,b.cou,0) as cou1,iif(b.selectTT=2,b.cou,0) as cou2,iif(b.selectTT=3,b.cou,0) as cou3,iif(b.selectTT=4,b.cou,0) as cou4,iif(b.selectTT=5,b.cou,0) as cou5"
sql = sql &" from member a left join (select memberID,selectTT,count(1) as cou from DATE2010 "
if request("start")<>"" then
……
iif(b.selectTT=0,b.cou,0) as cou0 是什么意思?
sql = sql &" 是什么意思,怎么使用?
三个SQL语句是什么关系?
sql &" from member a left join (select memberID,selectTT,count(1) as cou 又是怎么理解? 展开
4个回答
展开全部
tj = "" --将变量tj设为空字符串
if(b.selectTT=0,b.cou,0) as cou0 -- 如b.selectTT的值为0那么b.selectTT=b.cou 否则b.selectTT=0
sql = sql &" --将sql这个变量转换为字符串 sql+“” 和这个效果一样
sql &" from member a left join (select memberID,selectTT,count(1) as cou
-- left join左联表查询会从左表 (table_name1) 那里返回所有的行,即使在右表 (table_name2) 中没有匹配的行。如果有select memberID,selectTT,count(1) as cou 则返回这个值
if(b.selectTT=0,b.cou,0) as cou0 -- 如b.selectTT的值为0那么b.selectTT=b.cou 否则b.selectTT=0
sql = sql &" --将sql这个变量转换为字符串 sql+“” 和这个效果一样
sql &" from member a left join (select memberID,selectTT,count(1) as cou
-- left join左联表查询会从左表 (table_name1) 那里返回所有的行,即使在右表 (table_name2) 中没有匹配的行。如果有select memberID,selectTT,count(1) as cou 则返回这个值
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
tj = "" --将变量tj设为空字符串
if(b.selectTT=0,b.cou,0) as cou0 -- 如b.selectTT的值为0那么b.selectTT=b.cou 否则b.selectTT=0
sql = sql &" --将sql这个变量转换为字符串 sql+“” 和这个效果一样
sql &" from member a left join (select memberID,selectTT,count(1) as cou
-- left join左联表查询会从左表 (table_name1) 那里返回所有的行,即使在右表 (table_name2) 中没有匹配的行。如果有则返回select memberID,selectTT,count(1) as cou from DATE2010这个值
简单来说就是把 表table_name1 和 查询返回的 列表select memberID,selectTT,count(1) as cou from DATE2010 合成一个表的意思
if(b.selectTT=0,b.cou,0) as cou0 -- 如b.selectTT的值为0那么b.selectTT=b.cou 否则b.selectTT=0
sql = sql &" --将sql这个变量转换为字符串 sql+“” 和这个效果一样
sql &" from member a left join (select memberID,selectTT,count(1) as cou
-- left join左联表查询会从左表 (table_name1) 那里返回所有的行,即使在右表 (table_name2) 中没有匹配的行。如果有则返回select memberID,selectTT,count(1) as cou from DATE2010这个值
简单来说就是把 表table_name1 和 查询返回的 列表select memberID,selectTT,count(1) as cou from DATE2010 合成一个表的意思
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-02-18
展开全部
这里只是一条SQL语句。。
iif(b.selectTT=0,b.cou,0) as cou0的意思是:如果b.selectTT=0,那么就取b.cou作为结果,否则的话就取0作为结果,并且将值给cou0。
sql = sql &" 的意思是:和上面的SQL语句连为一个,通俗的讲:
sql=“这里只是";
sql = sql &" 一条SQL语句";
和sql=“这里只是一条SQL语句"等效的
iif(b.selectTT=0,b.cou,0) as cou0的意思是:如果b.selectTT=0,那么就取b.cou作为结果,否则的话就取0作为结果,并且将值给cou0。
sql = sql &" 的意思是:和上面的SQL语句连为一个,通俗的讲:
sql=“这里只是";
sql = sql &" 一条SQL语句";
和sql=“这里只是一条SQL语句"等效的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询