the problem is: is there a query in postgreSQL that will add some prefix to every record specific field? For example let's assume we have table users:
**id** **name**
1 adam
2 ewa
and i want to get records and add to every id some specific prefix - let's say 'foo_', desirable result:
id: 'foo_1', name: adam
id: 'foo_2', name: ewa
I know it can be done with Python after retrieving records, but i wonder if possible with query.
Thanks in advance!!
select 'foo_'||id::text,
name
from the_table;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With