Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1052 connectés 

  FORUM HardWare.fr
  Programmation
  SQL/NoSQL

  Fonction SQL tte simple

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Fonction SQL tte simple

n°1688857
Soluce
Prout ....
Posté le 19-02-2008 à 20:43:05  profilanswer
 

Hello tlm
 
j'ai la table suivante :
 
Nom----FOD---TFP---GO---GOPE
A-------Vrai---Vrai---Faux--Vrai
B-------Faux---Vrai---Faux--Vrai
C-------Vrai---Vrai---Faux--Faux
D-------Vrai---Faux--Faux--Vrai
 
Je voudrais faire une requette qui affiche le nom et les autres critères uniquement qd ils st vrais.
 
cad une table qui affiche :
 
Nom -- critère
A------FOD
A------TFP
A------GOPE
B------TFP
B------GOPE
C------FOD
C------TFP
D------FOD
D------GOPE
 
 
Voila si kkun pouvait me donner un coup de main ca serait sympa
 
Merci !
 
 
 

mood
Publicité
Posté le 19-02-2008 à 20:43:05  profilanswer
 

n°1688865
babasss
Posté le 19-02-2008 à 20:58:56  profilanswer
 

Code :
  1. SELECT Nom, 'FOD' AS critère FROM matable WHERE FOD = 'Vrai'
  2. UNION SELECT Nom, 'TFP' AS critère FROM matable WHERE TFP = 'Vrai'
  3. UNION SELECT Nom, 'GO' AS critère FROM matable WHERE GO = 'Vrai'
  4. UNION SELECT Nom, 'GOPE' AS critère FROM matable WHERE GOPE = 'Vrai'


MOi je ferais comme ca


---------------
Feedback : http://forum.hardware.fr/hfr/Achat [...] 2666_1.htm
n°1688980
Soluce
Prout ....
Posté le 19-02-2008 à 22:53:12  profilanswer
 

babasss a écrit :

Code :
  1. SELECT Nom, 'FOD' AS critère FROM matable WHERE FOD = 'Vrai'
  2. UNION SELECT Nom, 'TFP' AS critère FROM matable WHERE TFP = 'Vrai'
  3. UNION SELECT Nom, 'GO' AS critère FROM matable WHERE GO = 'Vrai'
  4. UNION SELECT Nom, 'GOPE' AS critère FROM matable WHERE GOPE = 'Vrai'


MOi je ferais comme ca


 
 
Merci, ça marche nikel. C'était pourtant assez simple...j'ai perdu trop de temps dessus.
A+


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  SQL/NoSQL

  Fonction SQL tte simple

 

Sujets relatifs
Aide fonction formattage tag Dailymotion / Youtubebib[JS] fonction item()
[SQL server] Transferer une base SQL sharepoint sur un nouveau serveur[SQL] Besoin d'aide pour un Update
la fonction CHMODProblème Requete SQL
[Oracle SQL] problème de script SettingsPHP, SQL Server et la langue arabe
[SQL Serveur] probleme requete avec calcul (tout bete)[SGBD Access 2007 pro] Comment exécuter une requête en SQL (débutant)
Plus de sujets relatifs à : Fonction SQL tte simple


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR