Thread: update multiple columns

update multiple columns

From
"Juliet May"
Date:
I am almost 100% positive that I have been able to set multiple columns while doing an update statement but for the life of me I can't remember exactly how I did it. I tried using parenthesis, comas, and "and" but none of it worked. Have I lost my mind. If not, can anyone see my mistake?
 
My code is below. TIA
 
Julie
 
 
update growernet_user
set email='madegn@hotmail.com'
set username='adegn'
where
user_id=696

Re: update multiple columns

From
Oliver Kohll
Date:
UPDATE growernet_user
SET email='madegn@hotmail.com', username='adegn'
WHERE user_id='696'

?

Oliver

> I am almost 100% positive that I have been able to set multiple columns
> while doing an update statement but for the life of me I can't remember
> exactly how I did it. I tried using parenthesis, comas, and "and" but none
> of it worked. Have I lost my mind. If not, can anyone see my mistake?
>
> My code is below. TIA
>
> Julie
>
>
> update growernet_user
> set email='madegn@hotmail.com'
> set username='adegn'
> where
> user_id=696


Re: update multiple columns

From
"Juliet May"
Date:
The comma gives me a parse error at or near "username". Without the comma I
get a parse error at or near "set".

Any other suggestions?

----- Original Message -----
From: "Oliver Kohll" <oliver@gtwebmarque.com>
To: <pgsql-novice@postgresql.org>
Sent: Thursday, July 11, 2002 6:15 PM
Subject: Re: [NOVICE] update multiple columns


UPDATE growernet_user
SET email='madegn@hotmail.com', username='adegn'
WHERE user_id='696'

?

Oliver

> I am almost 100% positive that I have been able to set multiple columns
> while doing an update statement but for the life of me I can't remember
> exactly how I did it. I tried using parenthesis, comas, and "and" but none
> of it worked. Have I lost my mind. If not, can anyone see my mistake?
>
> My code is below. TIA
>
> Julie
>
>
> update growernet_user
> set email='madegn@hotmail.com'
> set username='adegn'
> where
> user_id=696


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly


Re: update multiple columns

From
"Michael Paesold"
Date:
"Juliet May" <jmay@speark.com> wrote:

> The comma gives me a parse error at or near "username". Without the comma
I
> get a parse error at or near "set".
>
> Any other suggestions?
>
> ----- Original Message -----
> From: "Oliver Kohll" <oliver@gtwebmarque.com>
> To: <pgsql-novice@postgresql.org>
> Sent: Thursday, July 11, 2002 6:15 PM
> Subject: Re: [NOVICE] update multiple columns
>
>
> UPDATE growernet_user
> SET email='madegn@hotmail.com', username='adegn'
> WHERE user_id='696'

Did you try this exact query?

update growernet_user set email='madegn@hotmail.com', username='adegn' where
user_id=696;

only one "set"? only one comma between the two field=value pairs?

Michael



Re: update multiple columns

From
"Juliet May"
Date:
Duh!! My stupid! End of the day error I guess. Thanks for the help. I
shoulda known better :)
Julie
----- Original Message -----
From: "Michael Paesold" <mpaesold@gmx.at>
To: <pgsql-novice@postgresql.org>
Sent: Thursday, July 11, 2002 5:21 PM
Subject: Re: [NOVICE] update multiple columns


> "Juliet May" <jmay@speark.com> wrote:
>
> > The comma gives me a parse error at or near "username". Without the
comma
> I
> > get a parse error at or near "set".
> >
> > Any other suggestions?
> >
> > ----- Original Message -----
> > From: "Oliver Kohll" <oliver@gtwebmarque.com>
> > To: <pgsql-novice@postgresql.org>
> > Sent: Thursday, July 11, 2002 6:15 PM
> > Subject: Re: [NOVICE] update multiple columns
> >
> >
> > UPDATE growernet_user
> > SET email='madegn@hotmail.com', username='adegn'
> > WHERE user_id='696'
>
> Did you try this exact query?
>
> update growernet_user set email='madegn@hotmail.com', username='adegn'
where
> user_id=696;
>
> only one "set"? only one comma between the two field=value pairs?
>
> Michael
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org