【发布时间】:2020-04-06 17:29:35
【问题描述】:
我正在尝试命名我的查询输出,但我无法做到 这是我的代码
select countryname , datemonth
from city, payments,State,country,dt_date,rooms,customer
where year(payments.PayDate) >"2010"
ANd Payments.CustomerID = Customer.CustomerID
And State.CountryID = Country.CountryID
AND City.StateID = State.StateID
And Customer.CityID = City.CityID
and payments.DateID = dt_date.DateID
union
select countryname, datemonth
from city, payments,State,country,dt_date,rooms,booking,customer
where year(booking.DateBookingMade) >= "2010"
ANd booking.CustomerID = Customer.CustomerID
And State.CountryID = Country.CountryID
AND City.StateID = State.StateID
And Customer.CityID = City.CityID
and booking.DateID = dt_date.DateID;
我想将第一个选择命名为 payments,第二个选择命名为 booking 我的查询输出是
countryname datemonth
UK 12
USA 11
UK 6
UK 5
USA 2
what I want is
countryname datemonth status
UK 12 payment
USA 11 payment
UK 6 booking
UK 5 booking
USA 2 bookimg
感谢您的帮助
【问题讨论】: