I am working on an SQL statement that gets different rows from a database into different columns.
DB1:
id | name 1 | Shoe 2 | Jacket
db2:
id | type | image 1 | 0 | image_1_1.jpg 1 | 1 | image_1_2.jpg 1 | 2 | image_1_3.jpg 2 | 0 | image_2_1.jpg
the conclusion should be
id | name | image0 | image1 | image2 1 | Shoe | image_1_1.jpg | image_1_2.jpg | image_1_3.jpg 2 | Jacket | image_2_1.jpg | |
image0, where type = 0 image1 is where type = 1, etc.
I tried it in several ways, but I cannot figure it out.
Does anyone know how to do this?
source share