Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.23 KB | None | 0 0
  1. SELECT
  2.     item.f120_id,
  3.     item.f120_rowid,
  4.     item.f120_referencia,
  5.     item.f120_descripcion,
  6.     item.f120_id_grupo_impositivo,
  7.     item.f120_id_tipo_inv_serv,
  8.     item.f120_id_unidad_inventario,
  9.     SUM ( costo.f402_costo_este_nivel_uni ) + SUM ( costo.f402_costo_nivel_previo_uni ) AS costo_estandar,
  10.     item.f120_rowid_tercero_cli,
  11.     bodega.f150_id AS bodega_asignada,
  12.     item_ext.f121_rowid,
  13.     item_ext.f121_id_ext1_detalle
  14. FROM
  15.     unoee.dbo.t120_mc_items item
  16.     INNER JOIN unoee.dbo.t121_mc_items_extensiones item_ext ON item.f120_rowid = item_ext.f121_rowid_item
  17.     INNER JOIN unoee.dbo.t132_mc_items_instalacion instalacion ON item_ext.f121_rowid = instalacion.f132_rowid_item_ext
  18.     INNER JOIN unoee.dbo.t150_mc_bodegas bodega ON instalacion.f132_mf_rowid_bodega_asigna = bodega.f150_rowid
  19.     INNER JOIN unoee.dbo.t402_cm_costos costo ON item_ext.f121_rowid = costo.f402_rowid_item_ext
  20.     AND costo.f402_id_grupo_costo = 2
  21. WHERE
  22.     item.f120_id_cia = 1
  23.     AND item.f120_referencia = '1818'
  24. GROUP BY
  25.     f120_id,
  26.     f121_rowid,
  27.     f120_referencia,
  28.     f120_descripcion,
  29.     f120_id_grupo_impositivo,
  30.     f120_id_tipo_inv_serv,
  31.     f120_id_unidad_inventario,
  32.     f150_id,
  33.     f402_id_grupo_costo,
  34.     f120_rowid_tercero_cli,
  35.     f121_id_ext1_detalle,
  36.     f120_rowid,
  37.     f402_id_grupo_costo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement