List:General Discussion« Previous MessageNext Message »
From:Gavin Towey Date:June 15 2010 6:49pm
Subject:RE: query help
View as plain text  
Hi Richard,

This is a LEFT JOIN, but with only one table you may be wondering what to join.  Typically you'll have to create a new table that contains all the dates in the range you want to check.  Then you left join your transaction table, and all the rows from your dates table that don't have a match is your answer.

Regards,
Gavin Towey

-----Original Message-----
From: Richard Reina [mailto:richard@stripped]
Sent: Tuesday, June 15, 2010 11:30 AM
To: mysql@stripped
Subject: query help


I have a table similar to this:

 -------------------------
|transactions             |
|ID   |DATE      |EMPLOYEE|
|234  |2010-01-05| 345    |
|328  |2010-04-05| 344    |
|239  |2010-01-10| 344    |

Is there a way to query such a table to give the days of the year that employee 344 did not have a transaction?

Thanks for the help.

Richard

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1y@stripped


This message contains confidential information and is intended only for the individual named.  If you are not the named addressee, you are notified that reviewing, disseminating, disclosing, copying or distributing this e-mail is strictly prohibited.  Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any loss or damage caused by viruses or errors or omissions in the contents of this message, which arise as a result of e-mail transmission. [FriendFinder Networks, Inc., 220 Humbolt court, Sunnyvale, CA 94089, USA, FriendFinder.com
Thread
query helpRichard Reina15 Jun
  • RE: query helpGavin Towey15 Jun
  • RE: query helpJay Blanchard15 Jun
    • Re: query helpJoerg Bruehe16 Jun
  • Re: query helpRichard Reina16 Jun
    • RE: query helpMartin Gainty16 Jun