[SQL] How do i return a dataset from a stored procedure

2002-07-05 Thread teknokrat
I can't figure out how to return a group of rows from a function written in plpgsql (or plsql for that matter). The only way i have seen it done is with a setof table return value in sql. But since the query was a single select anyway i don't see the point of this. Is there a way of creating a tem

[SQL] Can this be done with sql?

2002-07-04 Thread teknokrat
In my database i have values recorded in one minute intervals. I would like a query that can get me results for other time intervals. For example - return maximum value in each 3 minute interval. Any ideas how i can do this with sql? I tried writing a procedure in plsql but i am told it does not s

Re: [SQL] Can this be done with sql?

2002-07-05 Thread teknokrat
""Rajesh Kumar Mallah."" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi , > > you can use GROUP BY , at the expense of adding one more column of SERIAL d= > ata type, > > say, > > select * from t_a limit 10; > access_log=3D# SELECT * from t_a limit 15; >

[SQL] manipulating the database in plsql

2002-07-08 Thread teknokrat
Is there any way to work with tables etc, in plsql? Can i get a get a database handle to the local database? If not, is there any chance for this to be implemented in the near future? thanks ---(end of broadcast)--- TIP 2: you can get off all lis

[SQL] Updating a table column with ref integrity

2002-11-15 Thread teknokrat
I need to to change the type of a table column. The problem is that this table has a ref integrity constarint set up with another table. Does anyone know how I can do this easily without breaking any constraints. thanks ---(end of broadcast)---

[SQL] help with troublesome query

2003-07-15 Thread teknokrat
I have three tables customers which 1-many with requests which is 1-1 with applications. all customers have at least one request but not all requests have an application. I want a query to return all the customers and their application data if they have any ( or else null). So this is like a le

[SQL] converting interval to timestamp

2003-07-31 Thread teknokrat
The difference of two dates/timestamps always gives an interval. is there a way to convert this interval into number such as number of milliseconds or number of days? Also does anyone know what field type an interval would map to in jdbc? thanks ---(end of broadcast)

[SQL] does postgresql execute unions in parallel?

2003-09-29 Thread teknokrat
If I have several selects joined with unions does postgresql execute the concurrently or not? thanks ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html

[SQL] row and column transposition

2003-10-07 Thread teknokrat
Anyone know some sql that display a row as a set of rows with column name vs column value? ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your

[SQL] indexing timestamp fields

2003-10-16 Thread teknokrat
Is it a good idea to index timestamp fields? what about date fields in general? thanks ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [SQL] indexing timestamp fields

2003-10-16 Thread teknokrat
Christopher Browne wrote: teknokrat <[EMAIL PROTECTED]> writes: Is it a good idea to index timestamp fields? what about date fields in general? If you need to order by a timestamp, then it can be worthwhile. If that timestamp can be null, and is rarely populated, then you might get a

[SQL] how do i get differences between rows

2003-12-22 Thread teknokrat
I am after an sql query that can give the differnces between consecutive timestamp values in the resultset. anyone know how to do this? thanks ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] how do i get differences between rows

2003-12-24 Thread teknokrat
Bruno Wolff III wrote: On Thu, Dec 18, 2003 at 12:21:35 +, teknokrat <[EMAIL PROTECTED]> wrote: I am after an sql query that can give the differnces between consecutive timestamp values in the resultset. anyone know how to do this? I think you can do something like the following (un

[SQL] grouping by date

2004-01-08 Thread teknokrat
How can I group by date given a timestamp column? thanks ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match