0

The issue is that I have each asset to have its tags, that is, number 6 to have 1,5 in a column, and asset 1 to have 1,3,5 PUTTING literally twice "asset_tag.tag_id" copies the same number of that row and separate it by comma

"image" is this CREATE VIEW image as SELECT asset_tag.asset_id FROM asset_tag GROUP BY asset_tag.asset_id ;

SELECT asset_tag.asset_id, concat_ws(',',asset_tag.tag_id,asset_tag.tag_id) AS etiqueta

FROM public.asset_tag

-- JOIN PUBLIC.imagen ON asset_tag.asset_id = imagen.asset_id

-- WHERE imagen.asset_id = asset_tag.asset_id

GROUP BY asset_tag.asset_id,asset_tag.tag_id

-- HAVING asset_tag.asset_id = imagen.asset_id ;

data: asest_id 1 1 1 6 6

tag_id 1 3 5 1 2

That is shown in tag_id 1,3,5 for asset_id 1 , and in the case of asset_id 6 that 1,2 come out

the data is of type integer

I have to get through a subquery but I don't see it,

enter image description herei want taht the group "6" have "5,1" , el "1" have "1,3,5" , what i`m doing wrong?

i see this : Sql select group by and string concat

and mine enter image description here

0 Answers0