G
G
Ghost_Inq2014-05-23 21:16:01
SQL
Ghost_Inq, 2014-05-23 21:16:01

SQL query to replace data in one table from another table to display the table on the screen

Good time of the day!
The second day I suffer with this request! It is necessary to replace one column in the table that stores the id from another table, it is necessary to replace it with the text associated with this id. The base is used by MS Access, requests are sent from under C#.
In my variants of implementation knocked out errors: 1) Syntax error FROM; 2) Type mismatch; 3) ad43a069dfe3470c948c76fd52a58dab.jpg
In this version, there was the first mistake No. 1:

SELECT ID_Товара, Название, Фирма_производитель, Стоимость, Количество_в_наличии FROM Изделие JOIN Фирмы_производители ON Изделие.Фирма_производитель=Фирмы_производители.Название_фирмы

This is mistake #2:
SELECT ID_Товара, Название, Фирма_производитель, Стоимость, Количество_в_наличии FROM Изделие INNER  JOIN Фирмы_производители ON Изделие.Фирма_производитель=Фирмы_производители.Название_фирмы

with no difference INNER, LEFT, etc.
And this is error number 3:
SELECT ID_Товара, Название, Фирма_производитель, Стоимость, Количество_в_наличии FROM Изделие FULL OUTER JOIN Фирмы_производители ON Изделие.Фирма_производитель=Фирмы_производители.Название_фирмы

Please help me find the right way to implement!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Ghost_Inq, 2014-05-26
@Ghost_Inq

The question is no longer relevant, the problem is solved. If anyone is interested, I'll leave a working request

SELECT Изделие.ID_Товара, Изделие.Название, Фирмы_производители.Название_фирмы, Изделие.Стоимость, Изделие.Количество_в_наличии FROM Фирмы_производители INNER JOIN Изделие ON Фирмы_производители.ID_Фирмы = Изделие.Фирма_производитель;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question