Skip site navigation (1) Skip section navigation (2)

Re: where to start with this procedure ?

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: Andrei Bintintan <klodoma(at)ar-sd(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: where to start with this procedure ?
Date: 2004-05-20 14:46:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Hi Andrei,

>Use the Offset and Limit in the SQL query.
>SELECT select_list
>    FROM table_expression
>    WHERE condition
>    LIMIT 50
>    OFFSET 10000
>This query will return 50 elements starting with the 10000 elements... so
>the elemenst from 10000 to 10050.

That isn't the issue since I only need a specific few of the lines at all.
I need a dynamic WHERE clause.

It's more like this :
SELECT customer_id, and, some, more, fields
FROM  table1
             JOIN table2
                       JOIN table3

This results in the "huge" set.
On the Access-form I only need the orders, or contact history for 1 

As of now I only know 2 ways to solve this.
1) Load all the tables over the net into Access and let the JOIN run 
locally. That way I can filter dynamically by adding a   WHERE 
customer_id = x   to the select above.
2) Let the JOINS run in a server based view and transfer the whole 
result into Access to fetch the few lines regarding the customer.

There should be something like:
a) Access calls a server based function with the customer_id as parameter.
b) The function calls the server based view and filters the result 
acording to it's parameter.
c) The function sends only the actually wanted lines back to Access.

In response to


pgsql-sql by date

Next:From: Stephan SzaboDate: 2004-05-20 15:01:52
Subject: Re: where to start with this procedure ?
Previous:From: Andrei BintintanDate: 2004-05-20 07:17:18
Subject: Re: where to start with this procedure ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group