How to get information from database into columns and rows?

Viewed 63

well, I have already posted it, but I didn't explain it properly, so I deleted the older post, and in this post, I'm gonna explain everything in detail.

In this picture you can see my database diagram.

Database Diagram

I only gonna use 3 tables namely:

  • tbl_transacciones
  • tbl_componentes
  • tbl_lineas

The information that I want to show in the SQL Query is like this:

Query Result

The quantitys of each linear column, is the SUM of all quantity that i have in tbl_transacciones with the same relationships.

For example, if in tbl_transacciones i have Some component, of some line, with X quantity, i want to show in my sql query, the sum of all components that have the same relationship, i hope that you can understand me, because my english is not so good, so i really hope that you can help me.

1 Answers
Related