views:

64

answers:

1

How can i select all id's for records in single cell?

For example: --example select of all values select id, name, address, phone from table

And get all id's where phone like '%555%' and show them in single field like: '111 123 234 321 231 234'

+3  A: 

If you are using Oracle 11gR2:

select LISTAGG(id, ' ') WITHIN GROUP (ORDER BY id) from table

If you are not running Oracle 11gR2, check if wm_concat function is available and do:

select wm_concat(id) from table

Keep in mind that you might want to combine these functions with group by clauses. Check out link I gave you for more options.

Pablo Santa Cruz