Jump to content

[SOLVED] two queries at once?


michaellunsford

Recommended Posts

The main query is pretty simple. The catch is, I only want DISTINCT `clientimages`.`event_name` fields. So, I'm thinking I need to embed a DISTINCT query inside the following?

[code]"SELECT `clientimages`.*,`options`.`value` WHERE `clientimages`.`event_name` = `options`,`keyfield`"[/code]
Link to comment
https://forums.phpfreaks.com/topic/33352-solved-two-queries-at-once/
Share on other sites

not terribly good at this, here's what I have -- but it's returning every record:

[code]SELECT DISTINCT  `clientimages`.`event_name`,  `clientimages`.`caption` ,  `options`.`value`
FROM  `clientimages` ,  `options`
WHERE  `clientimages`.`event_name` =  `options`.`keyfield` [/code]
I think I'm wrong here:[tt] DISTINCT [/tt]is affecting the whole sets of fields, not just [i]a[/i] field. See if the some of the User Comments [url=http://dev.mysql.com/doc/refman/5.0/en/select.html]here[/url] are helpful; I saw two that specifically dealt with this.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.