[SQL] select query optimization

2006-08-10 Thread sergey
Hi all! i run this query select f1,f2 from t1,t2 where t1.url_id=t2.entry_id and (t1.entry_stamp::date>=(now()::date-interval '14 days')) and the problem is that t1 is a very big table so the query is too slow. what if i move the second condition to where-clause. Can this reduce the select

[SQL] SELECT query/subquery problem

2004-07-20 Thread Caleb Simonyi-Gindele
I'm still trying to isolate issues with my SELECT query. I have a table in my veterinary software which stores my sales transactions. The pertinent columns are dat_staff_code (stores the doctor who gets credit for the sale), sys_tran_number (stores a unique transaction #), cli_credit_adj_trans_no (

Re: [SQL] select query that would join two databases

2003-07-31 Thread Rod Taylor
Take a look at the dblink() contrib module. PostgreSQL does not currently support inter-database joins BUT it does offer Schemas which is often enough. Take each of your source databases and toss them into two different schemas of the same database. On Wed, 2003-07-30 at 07:28, Keith H.K. Lam (U

[SQL] select query that would join two databases

2003-07-31 Thread Keith H.K. Lam (U1 Tech.)
dear all, How to create a query that would join two databases? In MSSQL, i use select * from dbA.dbo.tableA a dbB.dbo.tableB b where a.id=b.id Is there anyway to write the above query in postgressql ? Please email me back. Thanks, Keith ---(end of broadcast)

[SQL] SELECT query

2001-04-13 Thread Sharmad Naik
I have three table called table1, table2, table3 all having fields like: table1 contain id and username and id referencing table4 table2 contains id and parallel_username and id referencing table4 table3 contains id and other_username and id referencing table4 table4 is the main table containing