[SQL] restircting rows

2006-02-22 Thread padmanabha konkodi
hi all, my query return 100 rows but if i am intrested only from 40-60 rows then how to restrict. for example select * from students (returns 100 rows).but i am intrested only rows from 40 to 60.

Re: [SQL] passing array(java) to postgre sql function

2006-02-22 Thread Markus Schaber
Hi, Bond, bond wrote: public Object getArray(){ ArrayList temp = new ArrayList(); temp.add(); temp.add(); temp.add(T); temp.add(Q); return temp.toArray(); } After this i am passing this.getArray() values to database. As a first guess, have a

Re: [SQL] restircting rows

2006-02-22 Thread A. Kretschmer
am 22.02.2006, um 9:06:57 - mailte padmanabha konkodi folgendes: hi all, my query return 100 rows but if i am intrested only from 40-60 rows then how to restrict. for example select * from students (returns 100 rows).but i am intrested only rows from 40 to 60. select *

Re: [SQL] restircting rows

2006-02-22 Thread Richard Huxton
padmanabha konkodi wrote: hi all, my query return 100 rows but if i am intrested only from 40-60 rows then how to restrict. for example select * from students (returns 100 rows).but i am intrested only rows from 40 to 60. SELECT * FROM student ORDER BY something LIMIT 20 OFFSET 40; Be

Re: [SQL] restircting rows

2006-02-22 Thread Michael Glaesemann
On Feb 22, 2006, at 18:06 , padmanabha konkodi wrote: my query return 100 rows but if i am intrested only from 40-60 rows then how to restrict. for example select * from students (returns 100 rows).but i am intrested only rows from 40 to 60. See LIMIT and OFFSET.

[SQL] Feature, my misconception or bug??

2006-02-22 Thread Achilleus Mantzios
In PgSQL 7.4.12, foodb=# SELECT '255.255.255.255/24'::cidr; ERROR: invalid cidr value: 255.255.255.255/24 DETAIL: Value has bits set to right of mask. foodb=# SELECT '255.255.255.255/25'::cidr; cidr 255.255.255.255/25 (1 row) foodb=# in this case

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Peter Eisentraut
Am Mittwoch, 22. Februar 2006 13:04 schrieb Achilleus Mantzios: foodb=# SELECT '255.255.255.255/24'::cidr; ERROR: invalid cidr value: 255.255.255.255/24 DETAIL: Value has bits set to right of mask. in this case ... has no bits set to right of

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Markus Schaber
Hi, Peter, Peter Eisentraut wrote: Am Mittwoch, 22. Februar 2006 13:04 schrieb Achilleus Mantzios: foodb=# SELECT '255.255.255.255/24'::cidr; ERROR: invalid cidr value: 255.255.255.255/24 DETAIL: Value has bits set to right of mask. in this case ... has no

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Markus Schaber
Achilleus Mantzios wrote: In PgSQL 7.4.12, foodb=# SELECT '255.255.255.255/24'::cidr; ERROR: invalid cidr value: 255.255.255.255/24 DETAIL: Value has bits set to right of mask. foodb=# SELECT '255.255.255.255/25'::cidr; cidr 255.255.255.255/25 (1 row)

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Achilleus Mantzios
O Peter Eisentraut έγραψε στις Feb 22, 2006 : Am Mittwoch, 22. Februar 2006 13:04 schrieb Achilleus Mantzios: foodb=# SELECT '255.255.255.255/24'::cidr; ERROR: invalid cidr value: 255.255.255.255/24 DETAIL: Value has bits set to right of mask. in this case

[SQL] 'locking' the SELECTs based on indices...

2006-02-22 Thread Mario Splivalo
I have a table, like this: CREATE TABLE bla (id int4, code_id int4, code_value varchar, CONSTRAINT bla_pk PRIMARY KEY (id)) And, i have index on the table: CREATE INDEX bla_idx1 ON bla(code_id) Now, when I do this from one connection (psql shell, for instance): [A]BEGIN TRANSACTION; [A]SELECT

[SQL] Update in all tables

2006-02-22 Thread Judith
Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I don't want to code a script, so my question is if there is some way to update that field with a query and affects all the tables

Re: [SQL] Update in all tables

2006-02-22 Thread Janning Vygen
Am Mittwoch, 22. Februar 2006 19:08 schrieb Judith: Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I don't want to code a script, so my question is if there is some way to update

Re: [SQL] 'locking' the SELECTs based on indices...

2006-02-22 Thread Tom Lane
Mario Splivalo [EMAIL PROTECTED] writes: Now, when I do this from one connection (psql shell, for instance): [A]BEGIN TRANSACTION; [A]SELECT * FROM bla WHERE code_id = 1 FOR UPDATE; and then, from another psql i do: [B]SELECT * FROM bla WHERE code_id = 1 FOR UPDATE the second SELECT will

Re: [SQL] Update in all tables

2006-02-22 Thread Scott Marlowe
On Wed, 2006-02-22 at 12:08, Judith wrote: Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I don't want to code a script, so my question is if there is some way to update that

[SQL] Update in all tables

2006-02-22 Thread Judith Altamirano Figueroa
Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I don't want to code a script, so my question is if there is some way to update that field with a query and affects all the tables that

Re: [SQL] Update in all tables

2006-02-22 Thread Andrew Sullivan
On Wed, Feb 22, 2006 at 11:59:06AM -0600, Judith Altamirano Figueroa wrote: Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I don't want to code a script, so my question is if

Re: [SQL] Update in all tables

2006-02-22 Thread Scott Marlowe
On Wed, 2006-02-22 at 15:13, Andrew Sullivan wrote: On Wed, Feb 22, 2006 at 11:59:06AM -0600, Judith Altamirano Figueroa wrote: Hello everybody I need to update a field with the same value in the tables of my data base but this field exists in almost all tables and has the same value, I

Re: [SQL] Update in all tables

2006-02-22 Thread Owen Jacobson
Scott Marlowe wrote: On Wed, 2006-02-22 at 15:13, Andrew Sullivan wrote: No, sorry. While we're at it, though, if you have the same field in several tables, it's a good sign that your database is badly normalised. You shouldn't have to update more than one table (which is why there

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Feb 22, 2006 : Achilleus Mantzios wrote: In PgSQL 7.4.12, foodb=# SELECT '255.255.255.255/24'::cidr; ERROR: invalid cidr value: 255.255.255.255/24 DETAIL: Value has bits set to right of mask. foodb=# SELECT '255.255.255.255/25'::cidr;