par
azimut2000 » 27 nov. 2006, 02:05
Re,
Si je relis tous les post concernant ta demande, la seule fois ou je trouve "la base entière" c'est sur ton dernier.
Si tu ne sais pas comment obtenir ce qu'on te demande (la structure
d'une table et extraire quelques données de celle-ci), demande.
Pour obtenir la structure d'une table
Pour obtenir un certain nombre d'enregistrements
Où n représente le Nº de l'enrgistrement de départ et m le nombre d'enregistrements à extraire.
C'est cela que vous souhaitez avoir ?
Code : Tout sélectionner
CREATE TABLE `client` (
`id` int(11) NOT NULL,
`NomClient` text NOT NULL,
`ND` text NOT NULL,
`DateInstall` date NOT NULL,
`NbrTVHD` tinyint(4) NOT NULL,
`NbrTVSD` tinyint(4) NOT NULL,
`NbrPCFixe` tinyint(4) NOT NULL,
`NbrPCPortable` tinyint(4) NOT NULL,
`NbrLive` tinyint(4) NOT NULL,
`NbrLiveM` tinyint(4) NOT NULL,
`TypInstall` text NOT NULL,
`Type` text NOT NULL,
`PuissRecu` text NOT NULL,
`PuissEmise` text NOT NULL,
`LongEthernet` text NOT NULL,
`AdresseMAC` text NOT NULL,
`NumSerieONT` text NOT NULL,
`DescriptionPassage` text NOT NULL,
`Lieu` text NOT NULL,
`Info` text NOT NULL,
`LieuLB` text NOT NULL,
`InfoLB` text NOT NULL,
`HTache1a` time NOT NULL,
`HTache1b` time NOT NULL,
`HTache2a` time NOT NULL,
`HTache2b` time NOT NULL,
`nbr1` tinyint(4) NOT NULL,
`nbr2` tinyint(4) NOT NULL,
`CnxTVHD1` text NOT NULL,
`BouquetHD1` text NOT NULL,
`LieuTVHD1` text NOT NULL,
`TVHD1` text NOT NULL,
`CnxTVHD2` text NOT NULL,
`BouquetHD2` text NOT NULL,
`LieuTVHD2` text NOT NULL,
`TVHD2` text NOT NULL,
`CnxTVHD3` text NOT NULL,
`BouquetHD3` text NOT NULL,
`LieuTVHD3` text NOT NULL,
`TVHD3` text NOT NULL,
`CnxTVHD4` text NOT NULL,
`BouquetHD4` text NOT NULL,
`LieuTVHD4` text NOT NULL,
`TVHD4` text NOT NULL,
`CnxTVHD5` text NOT NULL,
`BouquetHD5` text NOT NULL,
`LieuTVHD5` text NOT NULL,
`TVHD5` text NOT NULL,
`CnxTVSD1` text NOT NULL,
`BouquetSD1` text NOT NULL,
`LieuTVSD1` text NOT NULL,
`TVSD1` text NOT NULL,
`CnxTVSD2` text NOT NULL,
`BouquetSD2` text NOT NULL,
`LieuTVSD2` text NOT NULL,
`TVSD2` text NOT NULL,
`CnxTVSD3` text NOT NULL,
`BouquetSD3` text NOT NULL,
`LieuTVSD3` text NOT NULL,
`TVSD3` text NOT NULL,
`CnxTVSD4` text NOT NULL,
`BouquetSD4` text NOT NULL,
`LieuTVSD4` text NOT NULL,
`TVSD4` text NOT NULL,
`CnxTVSD5` text NOT NULL,
`BouquetSD5` text NOT NULL,
`LieuTVSD5` text NOT NULL,
`TVSD5` text NOT NULL,
`CnxFixe1` text NOT NULL,
`fixe1` text NOT NULL,
`LieuPCFixe1` text NOT NULL,
`FIX1` text NOT NULL,
`CnxFixe2` text NOT NULL,
`fixe2` text NOT NULL,
`LieuPCFixe2` text NOT NULL,
`FIX2` text NOT NULL,
`CnxFixe3` text NOT NULL,
`fixe3` text NOT NULL,
`LieuPCFixe3` text NOT NULL,
`FIX3` text NOT NULL,
`CnxFixe4` text NOT NULL,
`fixe4` text NOT NULL,
`LieuPCFixe4` text NOT NULL,
`FIX4` text NOT NULL,
`CnxFixe5` text NOT NULL,
`fixe5` text NOT NULL,
`LieuPCFixe5` text NOT NULL,
`FIX5` text NOT NULL,
`CnxPortable1` text NOT NULL,
`portable1` text NOT NULL,
`LieuPortable1` text NOT NULL,
`POR1` text NOT NULL,
`CnxPortable2` text NOT NULL,
`portable2` text NOT NULL,
`LieuPortable2` text NOT NULL,
`POR2` text NOT NULL,
`CnxPortable3` text NOT NULL,
`portable3` text NOT NULL,
`LieuPortable3` text NOT NULL,
`POR3` text NOT NULL,
`CnxPortable4` text NOT NULL,
`portable4` text NOT NULL,
`LieuPortable4` text NOT NULL,
`POR4` text NOT NULL,
`CnxPortable5` text NOT NULL,
`portable5` text NOT NULL,
`LieuPortable5` text NOT NULL,
`POR5` text NOT NULL,
`CnxLiveM1` text NOT NULL,
`TypeLiveM1` text NOT NULL,
`LieuLiveM1` text NOT NULL,
`ZIK1` text NOT NULL,
`CnxLiveM2` text NOT NULL,
`TypeLiveM2` text NOT NULL,
`LieuLiveM2` text NOT NULL,
`ZIK2` text NOT NULL,
`CnxLiveM3` text NOT NULL,
`TypeLiveM3` text NOT NULL,
`LieuLiveM3` text NOT NULL,
`ZIK3` text NOT NULL,
`CnxLiveM4` text NOT NULL,
`TypeLiveM4` text NOT NULL,
`LieuLiveM4` text NOT NULL,
`ZIK4` text NOT NULL,
`CnxLiveM5` text NOT NULL,
`TypeLiveM5` text NOT NULL,
`LieuLiveM5` text NOT NULL,
`ZIK5` text NOT NULL,
`CnxLive1` text NOT NULL,
`TypeLive1` text NOT NULL,
`LieuLive` text NOT NULL,
`CAM1` text NOT NULL,
`CnxLive2` text NOT NULL,
`TypeLive2` text NOT NULL,
`LieuLive2` text NOT NULL,
`CAM2` text NOT NULL,
`CnxLive3` text NOT NULL,
`TypeLive3` text NOT NULL,
`LieuLive3` text NOT NULL,
`CAM3` text NOT NULL,
`CnxLive4` text NOT NULL,
`TypeLive4` text NOT NULL,
`LieuLive4` text NOT NULL,
`CAM4` text NOT NULL,
`CnxLive5` text NOT NULL,
`TypeLive5` text NOT NULL,
`LieuLive5` text NOT NULL,
`CAM5` text NOT NULL,
`TIC` text character set armscii8 NOT NULL,
`Dpt` int(5) default NULL,
`SAV` longtext character set armscii8,
`Prod` longtext character set armscii8 NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Dans tous les champs qui commencent par "Cnx", je peux avoir les données suivantes: "CPL", "Ethernet" ou "Wifi".
Donc, pour le même enregistrement, un ou plusieurs champs "Cnx" peuvent etre non NULL; s'ils le sont, je veux savoir combien de fois le mot "CPL" apparaît et ajouter 1 unité à chaque fois. Ensuite, ce calcul étant pour une seule ligne "datée", je veux savoir la même chose, mais sur plusieurs lignes définie et comprises entre 2 dates...
[quote="Ajoloca"]Re,
Si je relis tous les post concernant ta demande, la seule fois ou je trouve "la base entière" c'est sur ton dernier.
Si tu ne sais pas comment obtenir ce qu'on te demande (la structure [b]d'une[/b] table et extraire quelques données de celle-ci), demande.
Pour obtenir la structure d'une table [code]DESCRIBE nom_table;[/code]
Pour obtenir un certain nombre d'enregistrements [code]SELECT * FROM nom_table LIMIT n, m;[/code]
Où n représente le Nº de l'enrgistrement de départ et m le nombre d'enregistrements à extraire.[/quote]
C'est cela que vous souhaitez avoir ?
[code]
CREATE TABLE `client` (
`id` int(11) NOT NULL,
`NomClient` text NOT NULL,
`ND` text NOT NULL,
`DateInstall` date NOT NULL,
`NbrTVHD` tinyint(4) NOT NULL,
`NbrTVSD` tinyint(4) NOT NULL,
`NbrPCFixe` tinyint(4) NOT NULL,
`NbrPCPortable` tinyint(4) NOT NULL,
`NbrLive` tinyint(4) NOT NULL,
`NbrLiveM` tinyint(4) NOT NULL,
`TypInstall` text NOT NULL,
`Type` text NOT NULL,
`PuissRecu` text NOT NULL,
`PuissEmise` text NOT NULL,
`LongEthernet` text NOT NULL,
`AdresseMAC` text NOT NULL,
`NumSerieONT` text NOT NULL,
`DescriptionPassage` text NOT NULL,
`Lieu` text NOT NULL,
`Info` text NOT NULL,
`LieuLB` text NOT NULL,
`InfoLB` text NOT NULL,
`HTache1a` time NOT NULL,
`HTache1b` time NOT NULL,
`HTache2a` time NOT NULL,
`HTache2b` time NOT NULL,
`nbr1` tinyint(4) NOT NULL,
`nbr2` tinyint(4) NOT NULL,
`CnxTVHD1` text NOT NULL,
`BouquetHD1` text NOT NULL,
`LieuTVHD1` text NOT NULL,
`TVHD1` text NOT NULL,
`CnxTVHD2` text NOT NULL,
`BouquetHD2` text NOT NULL,
`LieuTVHD2` text NOT NULL,
`TVHD2` text NOT NULL,
`CnxTVHD3` text NOT NULL,
`BouquetHD3` text NOT NULL,
`LieuTVHD3` text NOT NULL,
`TVHD3` text NOT NULL,
`CnxTVHD4` text NOT NULL,
`BouquetHD4` text NOT NULL,
`LieuTVHD4` text NOT NULL,
`TVHD4` text NOT NULL,
`CnxTVHD5` text NOT NULL,
`BouquetHD5` text NOT NULL,
`LieuTVHD5` text NOT NULL,
`TVHD5` text NOT NULL,
`CnxTVSD1` text NOT NULL,
`BouquetSD1` text NOT NULL,
`LieuTVSD1` text NOT NULL,
`TVSD1` text NOT NULL,
`CnxTVSD2` text NOT NULL,
`BouquetSD2` text NOT NULL,
`LieuTVSD2` text NOT NULL,
`TVSD2` text NOT NULL,
`CnxTVSD3` text NOT NULL,
`BouquetSD3` text NOT NULL,
`LieuTVSD3` text NOT NULL,
`TVSD3` text NOT NULL,
`CnxTVSD4` text NOT NULL,
`BouquetSD4` text NOT NULL,
`LieuTVSD4` text NOT NULL,
`TVSD4` text NOT NULL,
`CnxTVSD5` text NOT NULL,
`BouquetSD5` text NOT NULL,
`LieuTVSD5` text NOT NULL,
`TVSD5` text NOT NULL,
`CnxFixe1` text NOT NULL,
`fixe1` text NOT NULL,
`LieuPCFixe1` text NOT NULL,
`FIX1` text NOT NULL,
`CnxFixe2` text NOT NULL,
`fixe2` text NOT NULL,
`LieuPCFixe2` text NOT NULL,
`FIX2` text NOT NULL,
`CnxFixe3` text NOT NULL,
`fixe3` text NOT NULL,
`LieuPCFixe3` text NOT NULL,
`FIX3` text NOT NULL,
`CnxFixe4` text NOT NULL,
`fixe4` text NOT NULL,
`LieuPCFixe4` text NOT NULL,
`FIX4` text NOT NULL,
`CnxFixe5` text NOT NULL,
`fixe5` text NOT NULL,
`LieuPCFixe5` text NOT NULL,
`FIX5` text NOT NULL,
`CnxPortable1` text NOT NULL,
`portable1` text NOT NULL,
`LieuPortable1` text NOT NULL,
`POR1` text NOT NULL,
`CnxPortable2` text NOT NULL,
`portable2` text NOT NULL,
`LieuPortable2` text NOT NULL,
`POR2` text NOT NULL,
`CnxPortable3` text NOT NULL,
`portable3` text NOT NULL,
`LieuPortable3` text NOT NULL,
`POR3` text NOT NULL,
`CnxPortable4` text NOT NULL,
`portable4` text NOT NULL,
`LieuPortable4` text NOT NULL,
`POR4` text NOT NULL,
`CnxPortable5` text NOT NULL,
`portable5` text NOT NULL,
`LieuPortable5` text NOT NULL,
`POR5` text NOT NULL,
`CnxLiveM1` text NOT NULL,
`TypeLiveM1` text NOT NULL,
`LieuLiveM1` text NOT NULL,
`ZIK1` text NOT NULL,
`CnxLiveM2` text NOT NULL,
`TypeLiveM2` text NOT NULL,
`LieuLiveM2` text NOT NULL,
`ZIK2` text NOT NULL,
`CnxLiveM3` text NOT NULL,
`TypeLiveM3` text NOT NULL,
`LieuLiveM3` text NOT NULL,
`ZIK3` text NOT NULL,
`CnxLiveM4` text NOT NULL,
`TypeLiveM4` text NOT NULL,
`LieuLiveM4` text NOT NULL,
`ZIK4` text NOT NULL,
`CnxLiveM5` text NOT NULL,
`TypeLiveM5` text NOT NULL,
`LieuLiveM5` text NOT NULL,
`ZIK5` text NOT NULL,
`CnxLive1` text NOT NULL,
`TypeLive1` text NOT NULL,
`LieuLive` text NOT NULL,
`CAM1` text NOT NULL,
`CnxLive2` text NOT NULL,
`TypeLive2` text NOT NULL,
`LieuLive2` text NOT NULL,
`CAM2` text NOT NULL,
`CnxLive3` text NOT NULL,
`TypeLive3` text NOT NULL,
`LieuLive3` text NOT NULL,
`CAM3` text NOT NULL,
`CnxLive4` text NOT NULL,
`TypeLive4` text NOT NULL,
`LieuLive4` text NOT NULL,
`CAM4` text NOT NULL,
`CnxLive5` text NOT NULL,
`TypeLive5` text NOT NULL,
`LieuLive5` text NOT NULL,
`CAM5` text NOT NULL,
`TIC` text character set armscii8 NOT NULL,
`Dpt` int(5) default NULL,
`SAV` longtext character set armscii8,
`Prod` longtext character set armscii8 NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
[/code]
Dans tous les champs qui commencent par "Cnx", je peux avoir les données suivantes: "CPL", "Ethernet" ou "Wifi".
Donc, pour le même enregistrement, un ou plusieurs champs "Cnx" peuvent etre non NULL; s'ils le sont, je veux savoir combien de fois le mot "CPL" apparaît et ajouter 1 unité à chaque fois. Ensuite, ce calcul étant pour une seule ligne "datée", je veux savoir la même chose, mais sur plusieurs lignes définie et comprises entre 2 dates...