Requette sql imbriquée ne retourne rien.

Résolu
soorr -  
 soorr -
Bonjour,

je souhaite faire une requette sql imbriquée mais j'ai n'ai rien en retour :

select * from 'tarifs' where taille = (SELECT distinct taille FROM 'tarifs' where marchand = '1')


le retour de
SELECT distinct taille FROM 'tarifs' where marchand = '1'

me retourne un tableau.

Qu'est ce qui cloche ?

Merci

2 réponses

  1. Doctor C Messages postés 630 Date d'inscription   Statut Membre Dernière intervention   400
     
    Si ton champ taille est un entier (un nombre ou même un string), tu ne peux pas le comparer à un tableau. Si tu veux vérifier les tailles qui se trouvent dans le tableau que tu as obtenu, tu dois utiliser le mot-clé IN.

    SELECT * FROM tarifs WHERE taille IN 
        (SELECT DISTINCT taille FROM tarifs WHERE marchand = '1')

    0