|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here! |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi.
This works, but it returns duplicates "INSERT INTO tblTargetAdd ( targetID ) SELECT * FROM Target WHERE (((Target.targetID)=" & Int(Me!lstAddACFT) & "));" THis eliminates the duplicates, but I can't seem to get it incorporated into the previous query SELECT target.targetID, Target.Name,Target.RSI FROM Target WHERE (((Target.RSI)="31101")) group by Target.Name,Target.RSI,TargetID; can one of you whiz-bang SQL-ers help me get the append query to ONLY append 1 copy of each? I can tell you that neither this INSERT INTO tblTargetAdd ( targetID ) SELECT * FROM Target WHERE target.targetID, Target.Name,Target.RSI IN (SELECT target.targetID, Target.Name,Target.RSI FROM Target WHERE Target.RSI="31101" group by Target.Name,Target.RSI,TargetID); nor this INSERT INTO tblTargetAdd ( targetID ) SELECT * FROM Target WHERE target.targetID IN (SELECT target.targetID, Target.Name,Target.RSI FROM Target WHERE Target.RSI="31101" group by Target.Name,Target.RSI,TargetID); Work. Thanks |
|
|||
|
Hi danlefree,
Thanks for takin the time to respond. I should have mentioned I'm using MS Access in which there is no LIMIT keyword. However,I got it to work as follows: INSERT INTO tblTargetAdd SELECT * FROM Target WHERE TargetID in (SELECT targetID FROM Target WHERE RSI="31101"); It only took 2 days of head-scratching to find what turned out to be a SIMPLE solution
|
|
||||
|
This might be what you're looking for:
Code:
MYSQL "SELECT ... WHERE ... LIMIT N" MS Access "SELECT TOP N WHERE ..."
__________________
Dan LeFree | Product Manager (Linux VPS Hosting) | Owner/Operator (Web development, marketing) |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |