Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT * FROM KO_UBIGEO
- -- @UBI= 15 se refiere a la localidad de lima
- DECLARE @UBI VARCHAR(3)=15
- SELECT arb.ID_CATEGORIA,arb.NOM_CATEGORIA Nombre,COUNT(arb.ID_CATEGORIA) n,
- 'http://kotear.pe/busqueda/?q&categs='+CONVERT(VARCHAR(6),arb.ID_CATEGORIA)+'&ub='+@UBI+'&ubic[]='+@UBI url
- FROM KO_CATEGORIA_ARBOL arb
- INNER JOIN KO_AVISO_CATEGORIA acat ON acat.ID_CATEGORIA=arb.ID_CATEGORIA
- AND arb.ADULTO=0
- INNER JOIN KO_AVISO avi ON avi.ID_AVISO=acat.ID_AVISO AND avi.EST=1
- AND avi.FLAG_MODERACION=0 AND FLAG_MODERACION_ADMIN=0
- AND FEC_FIN>GETDATE()
- GROUP BY arb.ID_CATEGORIA,arb.NOM_CATEGORIA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement