0

Is it possible to do query like this:

select wm_concat(some_attribute1) || some_string_attribute || wm_concat(some_attribute2)
from SomeTable;

Thanks,

2 Answers 2

2

You should only be able to do that if there is a group by

select wm_concat(some_attribute1) || some_string_attribute || wm_concat(some_attribute2)
from SomeTable
group by some_string_attribute;

or if the 2nd part is also an aggregate

select wm_concat(some_attribute1) || max(some_string_attribute) || wm_concat(some_attribute2)
from SomeTable
group by some_string_attribute;

But I don't think it will work as you have shown since you are mixing aggregate with non-aggregate, akin to

select product, sum(price) from sometable

(i.e. which product since there is no group by)

Sign up to request clarification or add additional context in comments.

Comments

2

Try this:

select
    wm_concat(attribute_the_first) colNameWon,
    the_agregation_attribute,
    wm_concat(attribute_the_second) colNameToo
from
    table_mien
group by
    the_agregation_attribute

If you get the results you want (in 3 columns), then the string concatination will give you what you seek.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.