社区
MS-SQL Server
帖子详情
怎样写这个查询
win1357
2003-10-10 10:54:47
两个表,要求查询表1中小于表2中某个字段值最大值
比如:通过查询表2 select column1 from tab1 where column2='111'
再查询表1 select max(col1<column1) from tab1
请教各位。
...全文
42
6
打赏
收藏
怎样写这个查询
两个表,要求查询表1中小于表2中某个字段值最大值 比如:通过查询表2 select column1 from tab1 where column2='111' 再查询表1 select max(col1<column1) from tab1 请教各位。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
yujohny
2003-10-10
打赏
举报
回复
select max(col1) from tab2
where col1< (select column1 from tab1 where column2='111')
txlicenhe
2003-10-10
打赏
举报
回复
sorry:
Select max(col1) from tab1 where column1 < (Select column1 from tab1 where column2 = '111')
txlicenhe
2003-10-10
打赏
举报
回复
Select max(col1) where column1 < (Select column1 from tab1 where column2 = '111') from tab1
伍子V5
2003-10-10
打赏
举报
回复
select max(a.col1) from table1 a
inner join table2 b
on a.col1<b.column1 and b.column2='111'
welyngj
2003-10-10
打赏
举报
回复
select top 1 col1 from tabl1 where col1<(select column1 from tab2 where column2='111') order by col1 desc
aierong
2003-10-10
打赏
举报
回复
create table ai(i int,ii int)
insert into ai select 1,2
insert into ai select 2,2
insert into ai select 3,2
create table aii(i int,ii int)
insert into aii select 1,2
insert into aii select 2,2
insert into aii select 3,2
select max(a.i)
from ai as a join aii as b
on a.i<b.ii
【MySQL】如何让数据库
查询
区分大小
写
当我们输入不管大小
写
都能
查询
到数据,例如:输入 aaa 或者aaA ,AAA都能
查询
同样的结果,说明在MySQL中,
查询
条件对大小
写
不敏感。 select * from some_table where str='abc'; select * from some_table where str=...
mysql 子
查询
怎么
写
_MySQL中两种子
查询
的
写
法
MySQL的测试环境测试表如下create table test_table2(id int auto_increment primary key,pay_id int,pay_time datetime,other_col varchar(100))建一个存储过程插入测试数据,测试数据的特点是pay_id可重复,这里在...
oracle 数据库循环
查询
语句怎么
写
,sql循环
查询
(sql语句循环
查询
详解)
sql循环
查询
(sql语句循环
查询
详解)2020-07-24 11:15:51共10个回答select*fromawheret_idin('3','4');select*fromawheret_idin(selectuser_idfrombwhereuser_idin('3','4'));select*fromawheret_id='3'ort_id='4'方法...
mysql
查询
语句,搜索怎样不区分大小
写
我们在设计mysql数据库的时候,如果设置了某个字段为 utf8_bin的时候,数据库的英文是要区分大小
写
的,但是我们在
查询
的时候,并不想 区分大小
写
,这个时候需要加上一个设定 collate `utf8_unicode_ci`。 综合而言:...
如何设计一个通用的
查询
接口
临近放假,手头的事情没那么多,老是摸鱼也不好,还是
写
写
博客吧。 今天来聊聊:如何设计一个通用的
查询
接口。 从一个场景开始 首先,我们从一个简单的场景开始。现在,我需要一个订单列表,用来
查询
【我的订单】,...
MS-SQL Server
34,590
社区成员
254,589
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章