设为首页收藏本站

SKY外语、计算机论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 12725|回复: 0
打印 上一主题 下一主题

写sql语句怎么实现下列查询

[复制链接]

65

主题

3

好友

739

积分

超级版主

Rank: 8Rank: 8

自我介绍
新年第一天据说有雨,全民齐赏日出的计划恐要泡汤。”宋仁宗拍着包拯的肩,“朕决定把你悬挂在城门上。”“但微臣额上的不是太阳是月亮啊!”“没事,挂久一点就会升级成太阳
生肖
星座
狮子座
性别

最佳新人 活跃会员 热心会员 推广达人 宣传达人 灌水之王 突出贡献 优秀版主 论坛元老

楼主
发表于 2013-6-18 15:14:30 |显示全部楼层
来个不一样的
CREATE TABLE sky(
w text,
j text);
insert into sky VALUES (1,2);
insert into sky VALUES (1,3);
insert into sky VALUES (1,4);
insert into sky VALUES (2,1);
insert into sky VALUES (2,2);
insert into sky VALUES (3,1);
insert into sky VALUES (4,1);
insert into sky VALUES (5,3);
insert into sky VALUES (5,2);

select s.w, (select min(j) from sky where w = s.w) from (select DISTINCT w as w from sky) s;
回复

使用道具 评分 举报

您需要登录后才可以回帖 登录 | 立即注册


手机版|SKY外语计算机学习 ( 粤ICP备12031577 )    

GMT+8, 2024-5-5 05:05 , Processed in 0.108536 second(s), 26 queries .

回顶部