Im using SLQ server 2005.
I have this table were i register a list of items creating an "order" wich will be sent to the warehouse so they know what it needs to be sent back.
this is my code.
id_pedido=id_order, id_articulo=id_item, descripcion=description, fecha=date, nombre=employee name, local=store, (inicia+entra+sale) Existencias=stocks, tipo=Kind, --estado=state, activo=active.--
select id, id_pedido, p.id_articulo, p.descripcion, p.fecha, u.nombre, p.local,a.inicia+a.entra-a.sale as Existencias, a.tipo
from pedidos p join usuarios u on p.id_usuario=u.id_usuario join articulos a on a.id_articulo=p.id_articulo
where estado='activo'
What i need is that in stocks column values ββare displayed only when the kind of the item is X. How can i show all rows with null in the stocks column when their kind is not X and the value when the kind is X?
This is because the client only want the employee to know the stock of those items but not of all the others.