Perform a query in SQL avoiding multiplicity [closed]

0

I have a table Producto and a table Proveedor (are related by campoidProducto ).

In this particular case I want a query that results in all the products, and for each product show a provider (a product can have several providers, you only need to show one since it is for a visualization of products).

    
asked by user47431 13.06.2017 в 07:03
source

1 answer

1

SELECT * FROM TABLE_PRODUCTS P INNER JOIN TABLE_PROVIDERS PR ON PR.IDPRODUCT = P.IDPRODUCT GROUP BY IDPRODUCT.

This would be the way. It is advisable to show the tests that you have done with the code and give more information about the tables, such as the common field with which to do the INNER JOIN.

    
answered by 13.06.2017 в 07:35