PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > me format this statement
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
me format this statement

Réponse
 
LinkBack Outils de la discussion
Vieux 12/03/2008, 00h14   #1
Brian Dunning
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut me format this statement

I am an idiot. table_a and table_b have exactly the same structure.
How do I say this in SQL:

INSERT (all records from table_a) into table_b where table_a.customer
= '12'

Just trying to eventually duplicate the whole table, one customer's
set of records at a time. Thanks.
  Réponse avec citation
Vieux 12/03/2008, 01h20   #2
wim.delvaux@adaptiveplanet.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: me format this statement

On Wednesday 12 March 2008 00:14:46 Brian Dunning wrote:
> I am an idiot. table_a and table_b have exactly the same structure.
> How do I say this in SQL:
>
> INSERT (all records from table_a) into table_b where table_a.customer
> = '12'
>
> Just trying to eventually duplicate the whole table, one customer's
> set of records at a time. Thanks.


IIRC ... something like

insert into Table_b select table_a where table_a.customer = '12'

Check the EXCELLENT docs at ...

http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html

.... and refer to the SQL statement syntaxes ... datamanipulation

HTH
W
  Réponse avec citation
Vieux 12/03/2008, 01h59   #3
Brian Dunning
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: me format this statement

Thanks to everyone who replied. So simple I couldn't see it. :-)
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h13.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14968 seconds with 11 queries