带连接的MYSQL更新

时间:2016-08-18 08:07:00

标签: mysql

运行查询时:

<div class="menu-option">
 
    <div class="title">
    </div>
    <input name="__RequestVerificationToken" type="text" value="CiVpO4FRnoe021mD68+lxPfMwBZygSRro9kFFZbmFzG89tqDv0QuHAyxo8Nsldeh8DkoVzd9+S0N7OGQhZtazNeFsmQ2ov4iuEfVCEYiHia4PVRRBCpIs/U2HvbjpffahdVYtabrA8p/XVy4TO8bh1ToRRY=">
    <div class="item">
        <a href="/Home/Index" class="formsMenu">
            <li class="viñeta3">Inicio</li>
        </a>
    </div>
    <ul class="padre">
        <a class="desplegable" href="#">
            <li class="viñeta3 viñetablanca desplegable">Administración dt</li>
        </a>
        <ul class="request-list subnavegador viñeta3" style="display: block;">
                <div class="item">
        <a href="/Campaign/List" class="formsMenu">
            <li class="viñeta3">Campañas</li>
        </a>
    </div>
    <div class="item">
        <a href="/Categories/List" class="formsMenu">
            <li class="viñeta3">Categorias</li>
        </a>
    </div>
    <div class="item">
        <a class="formsMenu">
            <li class="viñeta3" onclick="getForms()">Formularios</li>
        </a>
    </div>
    <div class="item">
        <a href="/PerformanceIndicator/List" class="formsMenu">
            <li class="viñeta3">Indicadores</li>
        </a>
    </div>
    <div class="item">
        <a href="/Hierarchies/List" class="formsMenu">
            <li class="viñeta3">Jerarquias</li>
        </a>
    </div>
    <div class="item">
        <a href="/Account/List" class="formsMenu">
            <li class="viñeta3">Usuarios</li>
        </a>
    </div>
    <div class="item">
        <a href="/StrategySettings/Index" class="formsMenu">
            <li class="viñeta3">Configurar estrategias</li>
        </a>
    </div>
    <div class="item">
        <a href="/ObjectPermissions/Index" class="formsMenu">
            <li class="viñeta3">Configurar permisos</li>
        </a>
    </div>
    <div class="item">
        <a href="/RedisCache/Index" class="formsMenu">
            <li class="viñeta3">Administracion REDIS caché</li>
        </a>
    </div>

        </ul>
    </ul>
    <ul class="padre">
        <a class="desplegable" href="#">
            <li class="viñeta3 viñetablanca desplegable">Nuevas Solicitudes</li>
        </a>
        <ul class="request-list subnavegador viñeta3" style="display: block;">
                <div class="item">
        <a class="formsMenu" onclick="CreateRequest('56ae9c06-7114-4d2a-9f9e-0f678b3130f4')">
            <li class="viñetablanca2">Credito Nuevo</li>
        </a>
    </div>

        </ul>
    </ul>
    <div class="item">
        <a onclick="WorkList('d5fe1e3d-2e08-41c2-9c62-0c57607de500','spGetAvailableInterviewsUser',0) " class="formsMenu">
<li class="viñeta3">Mis Solicitudes</li>        </a>
    </div>
    <div class="item">
        <a href="/Request/List" class="formsMenu">
            <li class="viñeta3">Busqueda de Solicitudes</li>
        </a>
    </div>

</div>

我收到语法错误,不知道吗?

UPDATE video v,akadam_post a,location l 
SET v.location_id=l.id 
WHERE a.encoding_id=v.id AND l.continentCode=a.loc_continent_code AND 
l.countryCode=a.loc_country_code AND l.regionCode=a.loc_region_code AND 
l.cityCode=a.loc_city_code

谢谢!

1 个答案:

答案 0 :(得分:1)

语法不正确,应该是

update video v
join akadam_post a on a.encoding_id=v.id
join location l on l.continentCode=a.loc_continent_code 
and l.countryCode=a.loc_country_code and l.regionCode=a.loc_region_code
and l.cityCode=a.loc_city_code
set v.location_id=l.id