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
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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.