Answer the question
In order to leave comments, you need to log in
How to create join two tables?
Hello! Help join two tables. Already as soon as join did not try, it is impossible. There are two tables:
block
blockID
blockType
block_text
textID
blockID
name
The second table contains the blockID of the elements of the first table. How can I join two tables, if I know that blockID = 3 in the second table, and output only one blockType for this id with join? All the others are displayed all the time in a column, but one is needed.
SELECT block_text*, block.blockType FROM block_text
JOIN block_text ON block_text.blockID = block.blockID WHERE block_text.blockID = 3
Answer the question
In order to leave comments, you need to log in
For some reason, you have a join of the same table as the select in your query,
but then you use "block"
How did such a query run at all ...
And why do you need to connect, because the connection goes by blockID
and blockID as you write, You already know that it is 3,
query then
SELECT block.blockType FROM block WHERE block.blockID = 3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question