0

我正在尝试运行连接多个表的选择查询。表中有一个具有点类型的列坐标。一切正常,但在连接中它不允许我选择 X(坐标)或 X(点(坐标))。

我可以在连接中选择坐标,也可以直接在表格上选择 X(坐标),但两者一起不起作用。

select x(coordinate) from location_coordinate

上面的一个作品

select ca.campus_id,
ca.campus_name,
ca.status_code,
ca_loc.location_id,
ca_loc.address,
ca_coo.coordinate,
ca_loc.locality_id,
ca_loc.area_id,
ca_loc.city_id,
ca_loc.state_id,
loc_locality.name as locality_name,
loc_area.name as area_name,
loc_city.name as city_name,
loc_state.name as state_name
    from campus_account ca 
     left join location ca_loc 
        on ca_loc.location_id=ca.location_id 
    left join location_coordinate ca_coo
        on ca_loc.location_id=ca_coo.location_id
    left join location_master loc_locality
        on(ca_loc.locality_id = loc_locality.location_master_id)
    left join location_master loc_area
        on(ca_loc.area_id = loc_area.location_master_id)
    left join location_master loc_city
        on(ca_loc.city_id = loc_city.location_master_id)
    left join location_master loc_state
        on(ca_loc.state_id = loc_state.location_master_id);

这也有效。但如果我尝试做

select ca.campus_id,
ca.campus_name,
ca.status_code,
ca_loc.location_id,
ca_loc.address,
ca_coo.X(coordinate),
ca_loc.locality_id,
ca_loc.area_id,
ca_loc.city_id,
ca_loc.state_id,
loc_locality.name as locality_name,
loc_area.name as area_name,
loc_city.name as city_name,
loc_state.name as state_name
from campus_account ca 
     left join location ca_loc 
        on ca_loc.location_id=ca.location_id 
    left join location_coordinate ca_coo
        on ca_loc.location_id=ca_coo.location_id
    left join location_master loc_locality
        on(ca_loc.locality_id = loc_locality.location_master_id)
    left join location_master loc_area
        on(ca_loc.area_id = loc_area.location_master_id)
    left join location_master loc_city
        on(ca_loc.city_id = loc_city.location_master_id)
    left join location_master loc_state
        on(ca_loc.state_id = loc_state.location_master_id);

它没有选择并给我一个错误,说 X 不是一列。

请帮忙

4

1 回答 1

1

应该X(ca_coo.coordinate)不是ca_coo.X(coordinate)

于 2013-04-09T00:22:14.637 回答