![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 2 of 2 total |
![]() |
Mon, Mar 23 2009 4:44 PM | Permanent Link |
andrej | Have a classic master/detail situation for documents. I need a query with a following
result: for a chosen document, I need to know for each detail if there are details of same kind followed the detail on the chosen document. In other words: if there are no details of same kind(on other documents) which are on a chosen document, then the result is an empty query. ps. let say that "same kind" means that they have same code. please advise |
Tue, Mar 24 2009 7:19 AM | Permanent Link |
"John Hay" | andrej > Have a classic master/detail situation for documents. I need a query with a following > result: for a chosen document, I need to know for each detail if there are details of same > kind followed the detail on the chosen document. In other words: if there are no details > of same kind(on other documents) which are on a chosen document, then the result is an > empty query. > ps. let say that "same kind" means that they have same code. I am not completely sure what you are after. If you have a table structure like the following and want all detail records that have the same detailcode as occur in the detail records of a particular master (eg 123) then MasterTable MasterId .... DetailTable MasterId DetailCode .... SELECT * FROM DetailTable WHERE MasterId <> 123 and DetailCode IN (SELECT DetailCode FROM DetailTable WHERE MasterId=123) John |
This web page was last updated on Wednesday, July 2, 2025 at 06:46 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |