sql中如何,查出兩行時間列相同的2行

時間 2022-06-28 19:30:04

1樓:匿名使用者

select a.* from d_meter a,d_meter b where

a.doc_create_date=b.doc_create_date

用以上例子查詢,其中 doc_create_date是表d_meter的一個日期型別的欄位

當然還得加上其他必要的條件,防止出現效能很差的sql

2樓:匿名使用者

select *

from tb k

where exists(select * from tb where k.時間列=時間列 and k.表裡的某個唯一列=表裡的某個唯一列)

如何更改sql中某列的值,如何更改SQL中某列的值

通過update方法實現。sql update table tablename t set filename 值1 where t.name 條件 解釋 更改某列,說明有條件,所有必須通過 where 條件語句定位到列。定位成功後,通過set方法給固定欄位賦值即可。上面sql語句的意思 更改tabl...

sql中如何插入一列數字從1到,sql中,如何插入一列數字從1到

sql2000用臨時表處理效率高,sql2005可用row number select top 100 id identity int,1,1 into from syscolumns a,syscolumns b insert table id select id from declare i i...

sql兩個表多列聯合查詢,SQL如何合併多個查詢結果

create table 流水錶 姓名 nvarchar 30 班級 nvarchar 30 備註 nvarchar 30 create table 課程 表 姓名 nvarchar 30 一班 int,二班 int 三班 int insert into 流水錶 values 張三 二班 備註1 李...