[SQL] Problem with tables and columns names

2011-12-19 Thread Gabriel Filipiak
Hi, so I am working on PostgreSQL 9.1.2 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 64-bit. It seems that i can't give a table name for example testTable it has to be test_table, because I can't access it via psql is that right or am I doing something wrong?

[SQL] Problem with pivot tables

2011-11-06 Thread Gabriel Filipiak
I have problem with creating a pivot table in postgreSQL using crosstab function. It works well but it produces many records for the same client_id, how can I avoid it? Here is the SQL: SELECT * FROM crosstab('SELECT client_id,extract(year from date), sum(amount) from orders group by extract( ye

[SQL] Dynamic sql

2011-09-09 Thread Gabriel Filipiak
Hi, this is my first on this list. I want to know the basics of dynamic sql especially in PostgreSQL. I was googling for a while but have no luck for getting a good described examples. Maybe someone here could give me some links to the materials from which you where studying this subject. Ok so t