insert statment

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
amao
Forum Newbie
Posts: 21
Joined: Sun May 10, 2009 5:13 am

insert statment

Post by amao »

dear all

I need to make insert rows in this from
ID static full
1 A A1
2 A A2

the first column ID second one static value equal "A" third column static value+ID
so please how to make the third value
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: insert statment

Post by mikemike »

Code: Select all

UPDATE TABLE SET `full`=CONCAT(`static`, `ID`)
amao
Forum Newbie
Posts: 21
Joined: Sun May 10, 2009 5:13 am

Re: insert statment

Post by amao »

mikemike wrote:

Code: Select all

UPDATE TABLE SET `full`=CONCAT(`static`, `ID`)
does it mean I will make concat with every insert 8O
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: insert statment

Post by mikemike »

every entry in the table. If you don't want to do that then stick a WHERE clause in
amao
Forum Newbie
Posts: 21
Joined: Sun May 10, 2009 5:13 am

Re: insert statment

Post by amao »

mikemike wrote:

Code: Select all

UPDATE TABLE SET `full`=CONCAT(`static`, `ID`)
I try to this but did not pass
UPDATE TABLE SET `full`=CONCAT(`static`, `ID`) where Id=Max(id)
It give me this error #1111 - Invalid use of group function
any suggestion please
Post Reply