How to get a connection from the pool

This is out of Aurelius scope. It's just SQL and your database-access component. When you perform such an SQL using TUniQuery directly, how do you access those values? It's exactly the same.


Usually it's recommended to use "as" to give fields alias: 
 p.id as p_id, pst.id as pst_id

Also note that what you're doing is not safe at all, as you can suffer from SQL injection.