
vista_instalacion



SELECT
    `e`.`Id`                  AS `Id`,
    `e`.`ns`                  AS `ns`,
    `e`.`IP_Equipo`           AS `IP_Equipo`,
    `e`.`IP`                  AS `IP`,
    `e`.`lastip`              AS `lastip`,
    `e`.`Puerto_Equipo`       AS `Puerto_Equipo`,
    `e`.`Columna 3`           AS `Columna 3`,
    `e`.`UltimaRecepcion`     AS `UltimaRecepcion`,
    `e`.`UltimoRegistro`      AS `UltimoRegistro`,
    `e`.`MinMaxSinPq`         AS `MinMaxSinPq`,
    `e`.`BytesTx`             AS `BytesTx`,
    `e`.`BytesRx`             AS `BytesRx`,
    `e`.`NCambiosIP`          AS `NCambiosIP`,
    `e`.`UltimaPeticion`      AS `UltimaPeticion`,
    `e`.`Cuarentena`          AS `Cuarentena`,
    `e`.`PIN`                 AS `PIN`,
    `e`.`Descriptor`          AS `Descriptor`,
    `e`.`id_motorcom`         AS `id_motorcom`,
    `e`.`numero_corto`        AS `numero_corto`,
    `e`.`numero_largo`        AS `numero_largo`,
    `e`.`diferenciahoraria`   AS `diferenciahoraria`,
    `e`.`estudiarcomm`        AS `estudiarcomm`,
    `e`.`estudiaralim`        AS `estudiaralim`,
    `e`.`asp`                 AS `asp`,
    `e`.`instalador`          AS `instalador`,
    COALESCE(`ins`.`nombre`, 'Sin Instalador') AS `instalador_nombre`,
    `e`.`instalacion`         AS `instalacion`,
    COALESCE(`i`.`nombre_inst`, 'Sin Instalación') AS `instalacion_nombre`,
    `e`.`tipoinstalacion`     AS `instalacion_tipo`,
    COALESCE(`t`.`nombre`, 'Sin Tipo') AS `instalacion_tipo_nombre`
FROM
    `equipos` AS `e`
LEFT JOIN
    `instalador` AS `ins` ON `e`.`instalador` = `ins`.`id`
LEFT JOIN
    `instalacion` AS `i` ON `e`.`instalacion` = `i`.`id_inst`
LEFT JOIN
    `instalacion_tipo` AS `t` ON `e`.`tipoinstalacion` = `t`.`id`;
