Re: [SQL] staggered query?

2004-04-21 Thread Denis P Gohel

 Hi Try this..

 SELECT Col1 , Col2
 FROM yourtable
 WHERE to_number(to_char(col1, 'SS'),'99') / 10 ) in
 (10,20,30,40,50,00);

 HTH

 Denis


> - Original Message -
> From: Vincent Ladlad <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 21, 2004 8:23 AM
> Subject: [SQL] staggered query?
>
>
> > hi! im new to SQL, and i need to find a solution
> > to this problem:
> >
> > i have a table with two columns, the first column
> > is of type timestamp.
> >
> > the table contains hundreds of thousands of records.
> > i need to get all the entries/records  at every 10 seconds
> > interval.  example, given a table:
> >
> > hh/mm/ss | data
> > ---
> > 00:00:00   1
> > 00:00:01   2
> > 00:00:02   3
> > 00:00:03   4
> > 00:00:04   5
> > 00:00:05   6
> > 00:00:06   7
> > 00:00:07   8
> > ..
> > ..
> >
> > my query should return:
> > 00:00:10
> > 00:00:20
> > 00:00:30
> > (etc)
> >
> > is this possible? if yes, how do i do it?
> >
> > thanks!
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.484 / Virus Database: 282 - Release Date: 5/27/2003
> >
> >
> >
> > ---(end of broadcast)---
> > TIP 4: Don't 'kill -9' the postmaster
>
>



---(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


[SQL] Record Lock details

2004-04-23 Thread Denis P Gohel

Hi all,

I am using PostgreSQL 7.3.1.

Is there a data dictionary in Postgres from where i can get the info about
locked rows of any table ? If possible the value of those locked record ?

My situation is like:

I have an ODBC application working on Postgres. There are Master child
tables. I want, if a user A is editing any document ( one master and set of
child records) in front-end application, the same should not be available to
other user for editing.

I thought of using SELECT FOR UPDATE. But, in my case, i need to display the
name of application user and other details about the locked row.

>From which data dictionary, i should query.

Any help would be appreciated.


Thanx

Denis





---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])