This is the code but why is there an error of Unknown column l.zipcode in field list when i declare location at the beginning?
select l.zipcode,sum(dum.tab) from location l,
(select count( Pickup_location) as tab from booking b,location l where b.pickup_location = l.Zip_Code
union select count(destination) as tab from booking_destinations bd inner join location l on bd.destination = l.Zip_Code where bd.sequence in(1,2,3)
union select count(destination) as tab from booking_destinations bd,location l where bd.destination = l.Zip_Code and sequence = 4
) as dum where l.zipcode = 18953;
What I have tried:
i have tried removing location at the beginning of sql statement