sql select 的用法
答案:3 悬赏:0
解决时间 2021-02-10 18:49
- 提问者网友:先森请一心
- 2021-02-10 11:09
sql select 的用法
最佳答案
- 二级知识专家网友:魅世女王
- 2021-02-10 12:48
"select * from strsql where reachtimes = (select max(reachtimes) from strsql)"
你这个strsql是想说是数据库的表名还是想说是你刚才定义的string?
如果不是表名的话是不能这么用的......
没必要这样写啊...
string strsql = select * from caltimes where studentid = '" + key + "' and course = '" + condition1 + "' and reachtimes = (select max(reachtimes) from strsql)";
这样的话就能一次完工了
你这个strsql是想说是数据库的表名还是想说是你刚才定义的string?
如果不是表名的话是不能这么用的......
没必要这样写啊...
string strsql = select * from caltimes where studentid = '" + key + "' and course = '" + condition1 + "' and reachtimes = (select max(reachtimes) from strsql)";
这样的话就能一次完工了
全部回答
- 1楼网友:一个很哇塞的汉子
- 2021-02-10 15:04
string strsql = 'select * from caltimes where studentid = ' + key + ' and course = '+ condition1
string strsql1 = 'select * from ('+strsql+') where reachtimes = (select max(reachtimes) from ('+strsql+')';
- 2楼网友:哥在撩妹请勿打扰
- 2021-02-10 13:45
sql 里面 as 用法是 给指定一个表(table) 命名。
比如
select * from employee as emp
这句意思是查找所有employee 表里面的数据,并把employee表格命名为 emp。
当你命名一个表之后,你可以在下面用 emp 代替 employee.
例如 select * from emp.
ps: as多用于 join 语句。(query with nested tables)
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯