这样的SQL select语句怎么写?怎么显示数据 distinct,order by,group by,having?这是我的数据:id addr temperature voltage others date_time 1335 0001 75.2 2.6 024 2010-11-13 19:45:151336 0002 75.3 2.6 024 2010-11-13 19:45:16 1337 0002 7

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/10 07:02:20

这样的SQL select语句怎么写?怎么显示数据 distinct,order by,group by,having?这是我的数据:id addr temperature voltage others date_time 1335 0001 75.2 2.6 024 2010-11-13 19:45:151336 0002 75.3 2.6 024 2010-11-13 19:45:16 1337 0002 7
这样的SQL select语句怎么写?怎么显示数据 distinct,order by,group by,having?
这是我的数据:
id addr temperature voltage others date_time
1335 0001 75.2 2.6 024 2010-11-13 19:45:15
1336 0002 75.3 2.6 024 2010-11-13 19:45:16
1337 0002 75.4 2.6 024 2010-11-13 19:45:17
1338 0003 75.5 2.6 024 2010-11-13 19:45:18
1339 0001 75.2 2.6 024 2010-11-13 19:45:19
1340 0002 75.3 2.6 024 2010-11-13 19:45:20
1341 0002 75.4 2.6 024 2010-11-13 19:45:21
1342 0003 75.5 2.6 024 2010-11-13 19:45:22
我要的结果:显示最新的addr不同的数据:
1339 0001 75.2 2.6 024 2010-11-13 19:45:19
1341 0002 75.4 2.6 024 2010-11-13 19:45:21
1342 0003 75.5 2.6 024 2010-11-13 19:45:22
我的目的是让以0001,0002,0003为地址的数据,各显示一条最新的,之后可能有0004,0005等等.每个不同的addr都显示一条最近的数据

这样的SQL select语句怎么写?怎么显示数据 distinct,order by,group by,having?这是我的数据:id addr temperature voltage others date_time 1335 0001 75.2 2.6 024 2010-11-13 19:45:151336 0002 75.3 2.6 024 2010-11-13 19:45:16 1337 0002 7
select * from table_name where date_time in
(select max(date_time) from table_name group by addr)
order by id

求单表查询的hql语句怎么写sqL如下:select * from aaa20 where aaae2001 = '11111111';求hql语句写法 sql如何取交集有这样两条sql语句select distinct id from a where id='123'select distinct id from a where id='456'我希望能把他们取得他们记录的交集,sql语句该如何写?错了 应该是这样的select distinct temid from a whe 清空某表的全部数据的SQL语句是不是这样写?SQL语句:truncate table phpcms_ads_stat SQL 语句 SELECT * FROM {{table}} WHERE `fleet_end_time` 这样的SQL select语句怎么写?怎么显示数据 distinct,order by,group by,having?这是我的数据:id addr temperature voltage others date_time 1335 0001 75.2 2.6 024 2010-11-13 19:45:151336 0002 75.3 2.6 024 2010-11-13 19:45:16 1337 0002 7 这句sql语句怎么改成left join的select 表2.a as a,表2.a as b,表2.a as c from 表1 a,表2 b,表2 c,表3 dwhere a.条件(+)=b.条件and a.条件(+)=c.条件and d.条件(+)=c.条件可能写错了,应该是这样的,抱歉select 这句sql语句怎么改成left join的select 表2.a as a,表2.a as b,表3.a as c from 表1 a,表2 b,表2 c,表3 dwhere a.条件(+)=b.条件and a.条件(+)=c.条件and d.条件(+)=c.条件可能写错了,应该是这样的,抱歉select sql 语句 建好表了 赋值语句怎么写 格式初学者 SELECT student_id FROM tuition where student_id in ( SELECT student_id FROM student_temp )上面的这个SQL语句是要选择student-id在student_temp 中的,而不是 tuition的,这样写有没有问题的?是我要得到的数据结果吗?运行 在SELECT-SQL语句的ORDER BY子句中,DESC表示按什么输出 SQL的SELECT语句有哪几部分构成?,作用分别是什么?,如何利用它们表达查询要求? sql语句 后面的(+) select * from t1,t2 where t1.a=t2.b(+) SQL语句:SELECT * from stu where name like %伟%;的作用是:_________________________. 这句SQL语句是什么意思.ql=select distinct(selabel) from.sql=select distinct(selabel) from kcwl_labprosellog where isdel=0 &sqlfile& and selabel not in (select distinct(selabel) from kcwl_labprosell) 这个语句是什么作用的.说具 insert into REC_OVER(ORG_ID) select '1' from dual where not exists (select ORG_ID from REC_OVER )insert into REC_OVER(ORG_ID) select '1' from dual where not exists (select ORG_ID from REC_OVER ) 请问oracle里这样的语句,为什么在sql/plus可 sql中怎么实现多个like条件的过滤,select b.a from b where b.c like ();like后面的括号里的条件数是不定的,如:'1_%','2_%'...,但是这样写的SQl好像不对,怎么改才能正确啊,后面的括号里面的条件是不能分 这个check语句怎么写啊?在SQL SERVER 2000中要写这样一个句子:车牌号字段,满足第一位是A字母,后面6为是0~9的数字.怎么写这个check语句啊?小弟在此有礼了! 请教这样查询语句该怎么写.有2个表格,第一个表查询数据库product表中前7条记录.sql = SELECT top 7 * FROM products where not isnull(Prod_Number) ORDER BY id ASC第二表要接着前面从第8条记录开始查到第15条记