RE: [PHP-DB] Slightly OT - maybe just SQL not php

From: Date: Tue, 21 Aug 2001 09:11:04 +0000
Subject: RE: [PHP-DB] Slightly OT - maybe just SQL not php
Groups: php.db 
Request: Send a blank email to php-db+get-11589@lists.php.net to get a copy of this message
On Sybase the following script: create table #temp_table ( a varchar(10), b numeric identity ) insert into #temp_table (a) values ("1234") insert into #temp_table (a) values ("234") insert into #temp_table (a) values ("134") insert into #temp_table (a) values ("124") insert into #temp_table (a) values ("22434") insert into #temp_table (a) values ("1245234") insert into #temp_table (a) values ("251234") insert into #temp_table (a) values ("3451234") insert into #temp_table (a) values ("1634234") select * from #temp_table update #temp_table set a = "N" + a select * from #temp_table go Produces the following output: a b ---------- --------------------- 1234 1 234 2 134 3 124 4 22434 5 1245234 6 251234 7 3451234 8 1634234 9 (9 rows affected) (9 rows affected) a b ---------- --------------------- N1234 1 N234 2 N134 3 N124 4 N22434 5 N1245234 6 N251234 7 N3451234 8 N1634234 9 (9 rows affected) > -----Original Message----- > From: George Pitcher [SMTP:fmdev@yahoo.co.uk] > Sent: Tuesday, August 21, 2001 09:31 > To: php-db@lists.php.net > Subject: [PHP-DB] Slightly OT - maybe just SQL not php > > Hi all, > > I have a MySQL table with approx 350,000 records (US aviation register) > and > the way the FAA produce it is without the 'N' prefix which I wish to add. > Can anyone point me to a sql command which will upodate the N-Number field > to 'N' + N-Number field? > > George, Edinburgh > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender.

« previous php.db (#11589) next »