Consult IN Clusters [closed]

-1

Good look here I have a question, because I have an Employee Table and a Sales Table, and for sale I have types of documents (Invoice Bill, etc), then the query I want to make in Sql Server 2014 is that I list the employees and show me the number that has been issued by said employee of each type of document and also their respective total amounts. For example: employee A issued 2 invoices 250.00            issued 3 tickets 300.00 employee B issued 5 invoices 1000.00            issued 1 ticket 200.00

I do not know if it could be done, if you help me please.

    
asked by CRISTHIAN MIGUEL GONZALES RUBI 05.10.2018 в 05:16
source

1 answer

1

the next time you publish the queries you have tried, so at least we would have the names of the fields and tables, but I'll tell you more or less what it would be like (inventing the names of the fields of course)

 SELECT E.EMPLEADO, COUNT(V.*) CANTIDAD, SUM(TOTAL) MONTO
 FROM EMPLEADOS E
 INNER JOIN VENTA V ON V.EMPLEADO = E.EMPLEADO
 GROUP BY E.EMPLEADO

If you fail to assemble your query, show the attempts you have made and thus help you better.

Greetings!

    
answered by 05.10.2018 в 16:19