can I write this statement shorter?
Select S_name
from
Supplier
JOIN Nation ON Supplier.S_nationkey = Nation.N_nationkey
JOIN Region on Nation.n_regionkey = region.R_regionkey
Where
Region.r_name = 'AFRICA'
Union
Select C_name
from
Customer
JOIN Nation ON Customer.C_Nationkey = Nation.N_nationkey
JOIN Region on Nation.N_regionkey = Region.R_regionkey
Where
Region.R_name = 'AFRICA'
and I want to order my output by name, But i dont know why, cause I do have C_name and S_Name as Output?!
thanks
If you want all the data in the same column then you can place a
SELECTaround it and then do anORDER BY.If you don’t need the data in the same column, then you could do it this way: