Re: [PHP-DB] Near-duplicate a row ?
Hello, "Sigurd Magnusson"! You wrote: > Whats the easiest way to duplicate a row, specifiying > only a new primary > number? > insert into () select , from where -- Piloteers do it on the road -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Near-duplicate a row ?
> Or are you going to riducule, saying 'what the hell do you need near-duplicate rows for'? :P what the hell do you need near-duplicate rows for? ;) Actually, I think it can be done with the subselect as you suggested in recent versions of mySQL (actually I'm not sure it's actually out yet...). I know that's not much help but I couldn't resist. You might check out mysql.com... assuming you're using mysql haha --Toby -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Near-duplicate a row ?
Whats the easiest way to duplicate a row, specifiying only a new primary number? Is the easiest way: 1. "SELECT * where primarykey=oldnum" 2. roll through the fields, getting current fields and values 3. "INSERT where primarykey=newnum" ... etc? Or is there an SQL statement to achieve this ?? like "INSERT (SELECT statement) WHERE primarykey=newnum" ? Or are you going to riducule, saying 'what the hell do you need near-duplicate rows for'? :P Siggy