實列:
1select
2 a.billdate '
[開票時間]',
3 a.hdbh '
[運單號]',
4 a.status '
運單狀態',
5 a.displaystatus '
運單狀態字',
6 b.name '
開票部門',
7 d.name '
運達部門',
8 b.orgattributes '
部門型別',
9e.memberproblem,
10e.customerresponse,
11e.handlesuggestion
12from
13shipment_bill a
14join sys_organization b on a.departmentid=
b.id
15join shipment_transport c on a.id=
c.billid
16join sys_organization d on c.enddepartment=
d.id
17join (select g.billid as billid ,g.memberproblem as memberproblem ,g.customerresponse as customerresponse,g.handlesuggestion as handlesuggestion from member_tracking g join (select billid,max(id)as id from member_tracking group
by billid) f on f.id=g.id) e on e.billid=
a.id
18where ---查詢樣表()
19 status in ( 0, 1, 2, 3
) 20
and a.createtime <
'2019-12-16'21
and a.isvalid =122
order
by23 a.billdate
---select g.billid as billid ,g.memberproblem as memberproblem ,g.customerresponse as customerresponse,g.handlesuggestion as handlesuggestion ---一層查詢
from member_tracking g
join
(select billid,max(id)as id from member_tracking group
by billid) f on f.id=g.id---查詢最大值(注意顯示列只有兩列,兩列以上才疏學淺,還不會)
SqlServer 插入多條資料
插入一條資料使用default關鍵字 insert into student studentno,loginpwd,studentname,gradeid,phone,address,borndate,email values 001 12345 張三 男 1,1234567890123 defau...
SQL更新多條資料
問題 有兩個不同的表,其中都有乙個編號的字段,而且儲存的內容是相同的,需要將一張表中的另外一些字段依據編號去與另乙個表中編號對應來更新到另乙個表中。方法 由於在sql中是不支援同時更新多條包含編號的資料的,所以當我們要更新多條資料的時候我們需要進行逐條的更新操作,這個時候我們需要用到游標。游標是只能...
pychars繪製多條資料
usr bin envpython coding utf 8 import pandas as pd from pyecharts.charts import bar,pie,line 設定 from pyecharts import options as opts from pyecharts.r...