社区
数据库(包含打印,安装,报表)
帖子详情
Select top 1 a from s where c>0
CoolCHEN
2004-09-03 02:07:50
Select top 1 a from s where c>0
这是取得第一条符合要求的a字段的值,如何取得第二条?
Select top 2 a from s where c>0出来的是两条纪录,我只要一条
...全文
118
6
打赏
收藏
Select top 1 a from s where c>0
Select top 1 a from s where c>0 这是取得第一条符合要求的a字段的值,如何取得第二条? Select top 2 a from s where c>0出来的是两条纪录,我只要一条
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
wumylove1234
2004-09-03
打赏
举报
回复
select top 1 * from
(select top 2 * from table where zsbh not in (select top 1 zsbh from table)) a
RUKYO
2004-09-03
打赏
举报
回复
Select Top 1 m.a From (Select Top 2 a,d From s Where c>0 Order By d Asc) m Order By m.d Desc
vbman2003
2004-09-03
打赏
举报
回复
SELECT TOP 1 a FROM s
WHERE c>0 And a NOT IN (SELECT TOP 1 a FROM s WHERE c>0)
ORDER BY a
apple1980
2004-09-03
打赏
举报
回复
select top 1 a from (Select top 2 a from s where c>0 order by id)aaa order by id desc
CoolCHEN
2004-09-03
打赏
举报
回复
一条SQL语句能不能搞定?
tztz520
2004-09-03
打赏
举报
回复
如果想第二条记录的话,就要把游标移到第二条上再取值了
select
* from table where 1<>1
一般是: CREATE TABLE B AS
SELECT
* FROM A WHERE 1这样就可以复制一个表结构而不复制数据。 因为ORACLE没有布尔字面值,不能写成 WHERE FALSE,而只能写成1就是不等于的意思,当然你写1=2,22
MySQL不能用
Select
top 1 * from...这样的语句
SELECT
top 1 * FROM version_manage where title ='mes' order by version desc > 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ...
两道sql面试题,关于where 1=0,
select
1,
select
top的理解
A1:
select
* into B from A where 1=0; 对应的Oracle的实现为 create table b as
select
* from a where 1=0; Q2:查数据表中第30到40条记录,有字段ID,但ID不是连续的。如何写SQL语句? A2:
select
* ...
SELECT
TOP 1 * FROM是什么意思
SELECT
TOP 1 * FROM的含义: 1、
select
为命令动词,含义为执行数据查询操作; 2、top 1子句含义为查询结果只显示首条记录; 3、*子句表示查询结果包括数据源中的所有字段; 4、from子句为指定数据源。 ...
解读
select
top x * from ...order by xxx desc
select
top x * from ...order by xxx desc按xxx降序顺序取出最上面的x条记录 sql="
select
top 4 * from SW_article where Passed=1 and IsGood=1 and minipic1 and UpdateTime>"&sysdate&"-7 order by Hits desc,...
数据库(包含打印,安装,报表)
1,217
社区成员
55,952
社区内容
发帖
与我相关
我的任务
数据库(包含打印,安装,报表)
VB 数据库(包含打印,安装,报表)
复制链接
扫一扫
分享
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章