I have a line of SQL that results in 2 repeating rows that could be any count:
SELECT ATTR_VAL
FROM [NDC_ATTR]
WHERE field_id IN (144,225)
Results:
1 H400
2 TESTTEXT
3 A200
4 TxtTst
....
I am trying to concatenate them together so they look like this:
1 TESTTEXT[H400]
2 TxTTst[A200]
...
I here is my current attempt which was mostly just trying to get them in the same field.
select
concat ([NDC_ATTR], ' ', [NDC_ATTR]) as newColumn
where
item_id = 185836
and field_id in (144, 225);
However, I am getting a bunch of errors saying that the column names are wrong.
I think this is because both cells come from the same column.
What am I doing wrong and how do I fix it?
Edit: returning data: