为了账号安全,请及时绑定邮箱和手机立即绑定

请问数据库 select后面可以加函数吗?

请问数据库 select后面可以加函数吗?

GCT1015 2019-09-20 18:14:33
请问数据库 select后面可以加函数吗?
查看完整描述

4 回答

?
慕盖茨4494581

TA贡献1850条经验 获得超11个赞

select 后面可以加函数啊,是条件的写在后面

for example: select avg(chengji) from student

查看完整回答
反对 回复 2019-09-22
?
Qyouu

TA贡献1786条经验 获得超11个赞

var objSelect=document.getElementById("select的id");
objSelect.options.add( new Option(txt, val));

查看完整回答
反对 回复 2019-09-22
?
慕运维8079593

TA贡献1876条经验 获得超5个赞

cursor xx is
SELECT case a when 1 then t1.field1, t1.field2, t1.field3...t1.fieldn
when 2 then t2.field1, t2.field2, t2.field3...t2.fieldn
ELSE NULL END
FROM table1 t1, table2 t2

查看完整回答
反对 回复 2019-09-22
?
幕布斯6054654

TA贡献1876条经验 获得超7个赞

如果是查询条件,可以用case when 构建,表的话好像没什么好办法。

有个办法,比较麻烦,
建一个临时表table3 like table1
if (a=1) then
insert into table3 select * from table1;
elsif (a=2) then
insert into table3 select * from table2;
end if;

cursor XX is
select * from table3





查看完整回答
反对 回复 2019-09-22
  • 4 回答
  • 0 关注
  • 460 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信