我有两张桌子。
1. tbl_courier (It has 2 Columns)
cons_no, orignal_awb
0906018 109118084926
0906018 109118085755
0906019 109118086800
etc
2. tbl_awb (it has 4 columns)
id awb_no courier_id active`
35 109118084926 8 y
36 109118085755 8 y
37 109118086800 8 y
38 109118086900 9 y
39 109118086950 9 y
cons_no, orignal_awb courier_id
0906018 109118084926 8
0906018 109118085755 8
0906019 109118086800 9
Select t.cons_no, t.orignal_awb, a.awb_no, a.courier_id
From tbl_courier t
JOIN awb a on t.orignal_awb = a.awb_no
cons_no orignal_awb awb_no courier_id
0906018 109118084926 109118084926 8
答案 0 :(得分:2)
可能是您的值包含一些隐藏的char,因为空间尝试修剪连接的值
import glob
import os
pat = "C:\\Users\\Smith\\folder1\\*.xls"
if any(os.path.isfile(file) for file in glob.glob(pat)):
print("File Exists")
else:
time.sleep(5)
答案 1 :(得分:0)
当我使用此查询时
选择t.cons_no,t.orignal_awb,a.awb_no,a.courier_id 来自tbl_courier t LEFT JOIN awb a on t.orignal_awb = a.awb_no
I get the following Result.
-------------------------------------------------
cons_no orignal_awb awb_no courier_id
0906019 109118344346 NULL NULL
0906019 1319418102705 NULL NULL
0906019 43275512350 NULL NULL
0906019 789525214389 NULL NULL
0906018 109118085755 NULL NULL
0906018 109118084926 109118084926 8
我想要这样:
cons_no orignal_awb awb_no courier_id
0906019 109118344346 109118344346 15
0906019 1319418102705 1319418102705 15
0906019 43275512350 43275512350 15
0906019 789525214389 789525214389 15
0906018 109118085755 109118085755 8
0906018 109118084926 109118084926 8