|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hello,
I am posting it here, as I tried on the french developer forum that I usually use but after dozen of replies, noone find a working solution! I'm getting mad with this problem! I'm spending hours on it. It MUST have a solution, but... I don't know if my brain can figure it out. Perhaps one of you have already done it or will see on the first look the QUERY... I'm explaining the problem: I have 2 tables: PDM_USER_2 Code:
MAINKEY | Name | ..... ************************ 1 | Tux | .... 2 | Bill | .... 3 | Jeff | .... ... | .... | .... 546 | JacK | .... 547 | Fred | .... 548 | Ludo | .... the second one: PDM_USER_DOSE_2 Code:
MAINKEY | UserID | PeriodID | ..... ************************ 1 | 2 | 2 | .... 2 | 362 | 5 | .... 3 | 125 | 12 | .... ... | .... | .. | .... 2546 | 425 | 9 | .... 2547 | 37 | 12 | .... 2548 | 13 | 11 | .... The AIM of THE QUERY: To get all the users identified by PDM_USER_2.MAINKEY that do not have a record in the PDM_USER_DOSE_2 for a specific period (i.e: 12) For the previous example, it shoul give all the ids from 1 to 548 less 125 and 37. Any help, tips, advice or whatever will be welcome... Thanks Ludo, Desesperate... ![]() Last edited by coume : August 15th, 2003 at 03:37 AM. |
|
#2
|
|||
|
|||
|
Code:
select PDM_USER_2.mainkey from PDM_USER_2 left join PDM_USER_DOSE_2 on PDM_USER_2.mainkey = PDM_USER_DOSE_2.userid and periodid = 12 where PDM_USER_DOSE_2.userid is null |
|
#3
|
|||
|
|||
|
GOSH!
That's working!!!!!!!!!!!!!!!!!!!!!! I don't know how I can thank you! But I really really appreciate! I should have posted here before! Thank you very much! swampBoogie You are a KING!!!! Cheers, Ludo |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > [MYSQL] Guru needed... Since one week, I'm on that QUERY but ... :( |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|