数据库 left join 优化问题

sql为: (求怎么优化)
select ra.send_address_id as id, ra.providerid as providerid, ra.contact_username as contactusername, p.name as provincename, c.name as cityname, cs.name as areaname, ct.name as countryname, ra.country as country, ra.city as city, ra.area as area , ra.province as province, ra.street_address as streetaddress, ra.postal_code as postalcode, ra.telphone as telphone, ra.user_mobile as usermobile, ra.is_default as isdefault, ra.publish_time as publishtime, ra.publish_man as publishman, ra.update_time as updatetime, ra.update_man as updateman, ra.states as states from send_address ra left join province p on ra.province = p.id left join city c on ra.city = c.id left join county_seat cs on ra.area = cs.id left join country ct on ra.country = ct.id where ra.states = :1 and ra.providerid = :2 order by ra.is_default asc, ra.update_time desc

查看全部
baiyang0413meng
baiyang0413meng
2015/06/19 04:47
  • sql
  • 点赞
  • 收藏
  • 回答
    私信

2个回复