Hello,
Table
subscriber looks like this :
| OBJECTKEY | NAME |
| 1 | Maxim |
Table
subscriber_locations looks like this :
| PARENTKEY | OBJECTKEY | location_id |
| 1 | 1 | 83 |
| 1 | 2 | 14 |
My motivation is a view that would return the following result :
| subscriber.OBJECTKEY | subscriber.NAME | locationCollection |
| 1 | MAXIM | 83,14 |
For this I've tried the folllwing but this fails with "not a GROUP BY expression"
CREATE VIEW SUBSCRIBER_SINGLEROW_CSV AS SELECT
subscriber.*, wmsys.wm_concat(subscriber_locations.location_id) locationCollection
FROM
subscriber, subscriber_locations
WHERE
subscriber.objectkey = subscriber_locations.parentkey
GROUP BY subscriber.objectkey
;{code}
Even when I try something simplier such as the example below I get the group by error, what am I doing wrong?
{code:sql}select subscriber.objectkey, subscriber_locations.location_id from subscriber, subscriber_locations where
subscriber.objectkey = subscriber_locations.parentkey GROUP BY subscriber.objectkey;
{code}
Thank you for helping.
Edited by: user10197381 on Dec 25, 2008 11:16 AM