回覆列表
  • 1 # Mnbcxs

    1、建立表,create table test_date(id number, v_date date, cnt number);2、插入測試資料,insert into test_date values(3, to_date(20190103,"yyyymmdd"), 13);insert into test_date values(2, to_date(20190102,"yyyymmdd"), 12);insert into test_date values(1, to_date(20190101,"yyyymmdd"), 10);commit;3、查詢表中記錄;select * from test_date ;4、編寫sql,實現所需目標;select t.*, t.cnt - b.cnt as minus_cnt from test_date t, test_date b where t.v_date - b.v_date(+) = 1 order by t.id

  • 中秋節和大豐收的關聯?
  • 48V電機能使用60V電瓶嗎?