Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
Selecting Duplicated |
Wed, Nov 14 2007 9:32 AM | Permanent Link |
Allan Brocklehurst | Hello;
Stats D& v4.25 b7 What I am trying to do is to identify all items within a DHA that have the same MFCNo asigned. There should be a unique MFCNo for each items with the DHA. Or to put it another way someone at the data entry level didn't care less if the MFCNo was accurate. I'm getting a littil punch drunk on this. Thanks in advance Allan here is my code select Distinct dha,mfcno, ItemNo, count(ItemNo) as CItemNo, OID AS LinkOID into memory\duptmp from SITESItem where mfcno is not null group by dha,mfcno having CItemNo > 1; create index myindex on memory\duptmp (mfcno); Select mfcno,* from SITESItem join "\memory\duptmp" on "\memory\duptmp".[mfcno] = [SITESItem].[mfcno] ORDER BY MFCNO; |
Wed, Nov 14 2007 10:40 AM | Permanent Link |
"Robert" | Your concept is OK, but selecting distinct will negate the logic, since it
eats the duplicates. You WANT the duplicates, so that you get count > 1. Robert "Allan Brocklehurst" <brock@ns.sympatico.ca> wrote in message news:586443C6-80BE-4AA4-81CE-E46C8B2AEA97@news.elevatesoft.com... > Hello; > Stats > D& > v4.25 b7 > > What I am trying to do is to identify all items within a DHA that have the > same MFCNo asigned. There should be a unique MFCNo for each items with the > DHA. Or to put it another way > someone at the data entry level didn't care less if the MFCNo was > accurate. > I'm getting a littil punch drunk on this. > > Thanks in advance > > Allan > > here is my code > > select Distinct dha,mfcno, ItemNo, count(ItemNo) as CItemNo, OID AS > LinkOID > into memory\duptmp > from SITESItem > where mfcno is not null > group by dha,mfcno > having CItemNo > 1; > create index myindex on memory\duptmp (mfcno); > > Select mfcno,* from SITESItem > join "\memory\duptmp" on "\memory\duptmp".[mfcno] = [SITESItem].[mfcno] > ORDER BY MFCNO; > |
Thu, Nov 15 2007 7:31 AM | Permanent Link |
Allan Brocklehurst | Thanks Robert;
"Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote: Your concept is OK, but selecting distinct will negate the logic, since it eats the duplicates. You WANT the duplicates, so that you get count > 1. Robert "Allan Brocklehurst" <brock@ns.sympatico.ca> wrote in message news:586443C6-80BE-4AA4-81CE-E46C8B2AEA97@news.elevatesoft.com... > Hello; > Stats > D& > v4.25 b7 > > What I am trying to do is to identify all items within a DHA that have the > same MFCNo asigned. There should be a unique MFCNo for each items with the > DHA. Or to put it another way > someone at the data entry level didn't care less if the MFCNo was > accurate. > I'm getting a littil punch drunk on this. > > Thanks in advance > > Allan > > here is my code > > select Distinct dha,mfcno, ItemNo, count(ItemNo) as CItemNo, OID AS > LinkOID > into memory\duptmp > from SITESItem > where mfcno is not null > group by dha,mfcno > having CItemNo > 1; > create index myindex on memory\duptmp (mfcno); > > Select mfcno,* from SITESItem > join "\memory\duptmp" on "\memory\duptmp".[mfcno] = [SITESItem].[mfcno] > ORDER BY MFCNO; > |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |