我有两个完全不同的表,如果它们的字段名不同,如何从它们中查看一个视图?
这是我的餐桌范例:
select
person.name as Name
, profession.specialty
, pp.name as FriendName
, customer.purchase
, appointment.date
from appointment
inner join profession
on appointment.profession_id = profession.id_person
inner join person person
on appointment.profession_id = person.id
inner join customer
on appointment.customer_id = customer.id_person
inner join person pp
on appointment.customer_id = pp.id
------------
select
dp.name as DoctorName
, doctor.specialty
, pp.name as PacientName
, pacient.disease
, appointment.date
from appointment
inner join doctor
on appointment.doctor_id = doctor.id_person
inner join person dp
on appointment.doctor_id = dp.id
inner join pacient
on appointment.pacient_id = pacient.id_person
inner join person pp
on appointment.pacient_id = pp.id