Bonjour,
Comment interdire qu'un champ integer puisse etre negatif dans une table?
Merci.
 
			
			






 
			
			
			
			 
			
				
 Interdire champ integer negatif
 Interdire champ integer negatif
				
				
						
						
				Bonjour,
Comment interdire qu'un champ integer puisse etre negatif dans une table?
Merci.
 
 
				
				
						
						
				Ajoute une contrainte sur la colonne. Exemple :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
5
6
7CREATE TABLE produits ( no_produit integer, nom text, prix numeric CHECK (prix > 0), prix_promotion numeric CHECK (prix_promotion > 0), CHECK (prix > prix_promotion) );
La théorie, c'est quand on sait tout mais que rien ne fonctionne.
La pratique, c'est quand tout fonctionne mais que personne ne sait pourquoi.
Ici, nous avons réuni théorie et pratique : Rien ne fonctionne ... et personne ne sait pourquoi !
Réplication de base avec Postgresql : http://scheu.developpez.com/tutoriel.../log-shipping/
Partager