易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql中如何根据sql语句执行结果执行其他sql语句

SQL code:

select case (select count(*) from pcardfull where uid=9) as t when t > 0 then (select * from pcardacct) else (select * from pcardfull) end



我想判断一条sql语句的结果然后根据结果执行其他不同的sql语句


三个表不一定有关系的,只是通过第一个sql执行结果去执行其他的语句,不想通过存储过程。

SQL code:

select case (select count(*) from tb1 where uid=9) as t when t > 0 then (select * from tb2) else (select * from tb3) end



引用
三个表不一定有关系的,只是通过第一个sql执行结果去执行其他的语句,不想通过存储过程。

SQL codeselectcase (selectcount(*)from tb1where uid=9)as twhen t>0then (select*from tb2)else (select*from tb3)end


那你考虑构造2楼的方式处理吧

引用三个表不一定有关系的,只是通过第一个sql执行结果去执行其他的语句,不想通过存储过程。

SQL code

select case (select count(*) from tb1 where uid=9) as t when t > 0 then (select * from tb2) else (select * from tb3) end


用二楼的方法吧

SQL code



Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.co


相关问答:

mysql的连接超时时间怎么设置 - VC/MFC / 数据库

我是用mysql自带的C API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))

AfxMessageBox("数据库连接失败") ......

需要视频教程的新手进 php + mysql + apache 配置

这个视频讲的很详细, 对新手非常有用, 基本上一看就懂
由于太大了(50m, 我只能上传20m), 我上传不了, 只好贴出下载地址
下载地址: http://ftel1.3800hk.com/0807/080720djxnzj.rar
好东西,下个看看


......

关于SQLSERVER底层问题 - MS-SQL Server / 疑难问题

请问一下,外网两台SQLSERVER实例数据传输,有没有采用数据压缩和加密。压缩比是多少,加密是什么加密算法?相关文档哪里可以找到?谢谢


我也想知道!关注此贴!

关注~~

数据库大牛都哪去了啊?
......

用PHP排序mysql问题

不知道是不是我的xampp有问题,mysql是图形化的!
一个ID组在我的mysql的表里面 2,5,8,7
点了排序,然后用PHP文件连接这个表显示表的信息时,ID的顺序还是不变!应该是2,5,7,8的吧升序排序后!
在PHP文件里 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号