Query in SQL Server without "WHERE"

0

I am creating some reports and I really have no problem with the following query, as you can see it is simple and runs well but I realized that forget to put the " where " and it still works correctly; I had never seen anything like it before; I would like to know what is the reason why it runs correctly? , what I thought at first was that the on worked in a certain way as a where . but I'm not sure.

select nodo1.*,tareas.nombre_flujo,tareas.descripcion_tarea+' '+tareas.anexo1
    from(   
        select pren.linea, pren.orden, pren.tipo_cambio,pren.fecha_inicio,pren.noun,detalle.id_tarea
        from mecaprensa as pren inner join control_tareas_flujo_produccion as detalle on (pren.id_mecaprensa=detalle.id_documento)
        and pren.orden like '00015'
    ) as nodo1 inner join desc_tarea as tareas on (tareas.no_tarea=nodo1.id_tarea)
    ORDER BY termino 

Note: many seek answers only when something does not go well, but this makes me curious, it may be used strategically in other queries .

    
asked by Cesar Rojas 31.08.2018 в 22:04
source

1 answer

-1

That's because you're already adding a specific condition within JOIN , but with that you're making the query only show you ( ALWAYS ) the same information, in your case, everything related with pren.orden = '00015'

    
answered by 31.08.2018 в 22:23