Re: [SQL] update question

2005-12-05 Thread Matthew Peter
Like WHERE 1 = 1, but in UPDATE table SET value = 1, 1 = 1; Yahoo! Personals Single? There's someone we'd like you to meet. Lots of someones, actually. Try Yahoo! Personals

Re: [SQL] update question

2005-12-05 Thread Matthew Peter
it's in a loop so there's an extra comma at the end so i was thinking i could put in a throw away value to keep the update from breaking if there's an additional commaJaime Casanova <[EMAIL PROTECTED]> wrote: On 12/5/05, Matthew Peter wrote:> I need a throw away value

[SQL] update question

2005-12-05 Thread Matthew Peter
I need a throw away value for an insert statement... example...update table set value = 1, value = 2, throw_away_value -- so i don't break the query where id = 1; Thanks Yahoo! Personals Let fate take it's course directly to your email. See who's waiting for you Yahoo! Personals

Re: [SQL] problems with array

2005-10-18 Thread Matthew Peter
Ya, I didn't test it. The error message was expecting an integer not an array, so coverting it to a list crossed my mind 'assuming' the subselect 'could' return a string of integers for the IN clause. Oh well. I'm glad there's people like you test it. --- Michael Fuhr <[EMAIL PROTECTED]> wrote:

Re: [SQL] problems with array

2005-10-18 Thread Matthew Peter
Not sure if you got this figured out but I think SELECT * from tb_cat WHERE id IN (SELECT array_to_string(cat,',') as cat FROM tb_array WHERE id=1); is what your looking for? --- paperinik 100 <[EMAIL PROTECTED]> wrote: > PostgreSQL is 7.4.7. > > My first table > CREATE TABLE tb_cat ( > id I

Re: [SQL] delete item[5] from varchar[] array???

2005-09-23 Thread Matthew Peter
--- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Fri, Sep 23, 2005 at 10:02:44AM -0700, Matthew > Peter wrote: > > --- Michael Fuhr <[EMAIL PROTECTED]> wrote: > > > test=> UPDATE foo SET a = a[1:3] || a[5:6]; > > > > I sure hope there is a better w

Re: [SQL] delete item[5] from varchar[] array???

2005-09-23 Thread Matthew Peter
--- Michael Fuhr <[EMAIL PROTECTED]> wrote: > On Wed, Sep 21, 2005 at 06:56:36PM -0700, Matthew > Peter wrote: > > How is it possible to delete an item from a single > > dimension varchar[] array? Lets say it has the > values > > {1,2,3,4,5,6}... how do i del

Re: [SQL] delete item[5] from varchar[] array???

2005-09-21 Thread Matthew Peter
Ya. I didn't see any in the \df. If it's so simple could you show me one? PLEEEASE Thanks MP --- Tom Lane <[EMAIL PROTECTED]> wrote: > Matthew Peter <[EMAIL PROTECTED]> writes: > > How is it possible to delete an item from a single > > dimension va

[SQL] delete item[5] from varchar[] array???

2005-09-21 Thread Matthew Peter
How is it possible to delete an item from a single dimension varchar[] array? Lets say it has the values {1,2,3,4,5,6}... how do i delete at position [4]? Could this be done in a SQL statement or a function? I appreciate any help. Thank you MP _