查询数据表里面的数据,有条件是变量这样的SQL语句应该怎么写

查询数据表里面的数据,有条件是变量这样的SQL语句应该怎么写,第1张

create proc mypr1

@pe int

As

select aname name1,a,b from piwik_site a,piwik_archive_numeric_2013_10 b where aidsite=bidsite and bname='nb_visits' and period=@pe order by bvalue desc

select idsite,sum(value)

from (select from piwik_archive_numeric_2013_11

union all select from piwik_archive_numeric_2013_12) t

where name='nb_visits' and period=1

and date1 between curdate() - interval 31 day and curdate() - interval 1 day

group by idsite order by sum(value) desc

以上就是关于查询数据表里面的数据,有条件变量这样的SQL语句应该怎么写全部的内容,包括:查询数据表里面的数据,有条件是变量这样的SQL语句应该怎么写、SQL语句关于跨表查询应该怎样写、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9741384.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-01
下一篇 2023-05-01

发表评论

登录后才能评论

评论列表(0条)

保存