Query in SQL Server

0

When doing the following query

select * FROM conta

It brings up the columns, with id_fornecedor coming from the fornecedor table

  id | id_fornecedor | conta_status
  1  |      1        |     S

I'd like to bring the name of it as well as id_fornecedor .

    
asked by anonymous 25.05.2016 / 13:55

1 answer

2

Friend, probably the vendor data is in another table, correct?

You can do this by bringing the related data (in this case the vendor name) from that other table.

Let's imagine that the name of the other table is provider , okay?

SELECT c.*, f.nome
  FROM conta c
 INNER JOIN fornecedor f ON f.id_fornecedor = c.id_forncedor

If your question persists, return with more details of the tables (table name, column names, etc ...)

I hope I have helped.

    
25.05.2016 / 14:01