Advertisement
slovacus

consulta kotear

Mar 23rd, 2012
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.52 KB | None | 0 0
  1. SELECT kca.nom_categoria,COUNT(avi.id_aviso) AS n
  2. FROM  KO_AVISO AS avi
  3. INNER JOIN KO_AVISO_CATEGORIA AS kac ON kac.ID_AVISO = avi.ID_AVISO
  4. INNER JOIN KO_CATEGORIA_ARBOL AS kca ON kca.ID_CATEGORIA = kac.ID_CATEGORIA
  5. WHERE
  6. avi.ID_UBIGEO = 15
  7. AND kca.ADULTO=0
  8.  AND avi.EST=1
  9.  AND avi.FLAG_MODERACION=0
  10.  AND FLAG_MODERACION_ADMIN=0
  11.  AND FEC_FIN>GETDATE()
  12.  AND kca.ID_CATEGORIA IN (231,221,237,
  13.  243,235,208,228,
  14.  234,226,233,232,
  15.  244,230,1909,
  16.  229,1621,219,247,1381,
  17.  241,217,3489
  18.  )
  19.  GROUP BY kca.NOM_CATEGORIA ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement