數據集是以下幾點:連接來自兩個字段的數據,忽略其中一個空值的數據?
FirstName LastName city street housenum
john silver london ukitgam 780/19
gret garbo berlin akstrass 102
le chen berlin oppenhaim NULL
daniel defo rome corso vinchi 25
maggi forth london bolken str NULL
voich lutz paris pinchi platz NULL
anna poperplatz milan via domani 15/4
寫下面的查詢:
SELECT Trim(a.FirstName) & ' ' & Trim(a.LastName) AS employee_name,
a.city, a.street + ' ' + a.housenum AS address
FROM Employees AS a
結果會像這樣:
employee_name city address
john silver london ukitgam 780/19
gret garbo berlin akstrass 102
le chen berlin NULL
daniel defo rome corso vinchi 25
maggi forth london NULL
voich lutz paris NULL
anna poperplatz milan via domani 15/4
,但我想這一點:
employee_name city address
john silver london ukitgam 780/19
gret garbo berlin akstrass 102
le chen berlin oppenhaim
daniel defo rome corso vinchi 25
maggi forth london bolken str
voich lutz paris pinchi platz
anna poperplatz milan via domani 15/4
請幫幫我。
只有當你有任何疑問,你可以問我這裏。 – Sonia