Viele MySQL-Datenbankabfragen

Hallo Matthias,

ja ich habe es schon ausprobiert. Ich probiere es gerade nocheinmal...

immer noch die Meldung:
#1241 - Operand should contain 1 column(s)

mit der Abfrage:
SELECT `p`.*, (SELECT
`text` AS `CommentText`,
`EMail` AS `CommentMail`
FROM `all_comment`
WHERE `all_comment`.`pic_id_fk` = `p`.`id`
ORDER BY `id`
LIMIT 1)
FROM `all_pictures` `p`


Viele herzliche Grüße
Matze
 
Hallo,

dann probier es mal hiermit:
Code:
SELECT
  `p`.*,
  `c`.`text`,
  `c`.`email`
FROM
  `all_pictures` `p`
LEFT JOIN
  `all_comment` `c` ON (
    `c`.`id` = (
      SELECT MIN(`id`)
      FROM `all_comment`
      WHERE `all_comment`.`id` = `p`.`id`
    )
  )

Grüße,
Matthias
 

Neue Beiträge

Zurück