User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 373,935 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,078 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 3732 | Replies: 13
Reply
Join Date: Aug 2006
Posts: 9
Reputation: lorraine1000 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lorraine1000 lorraine1000 is offline Offline
Newbie Poster

Re: duplicate rows

  #11  
Aug 2nd, 2006
SELECT COUNT(*), sID1, sID2, sID3 FROM ITEM_T
WHERE sItemID NOT IN (400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418,
419, 420, 421, 422, 423, 425, 426, 427, 428, 428, 706,707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718,
719, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 737, 738, 745, 746)
GROUP BY sID1, sID2, sID3
HAVING COUNT(*)>1
UNION
SELECT COUNT(*), sID1, sID2, sID3 FROM BANKITEM_T
WHERE sItemID NOT IN (400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418,
419, 420, 421, 422, 423, 425, 426, 427, 428, 428, 706,707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718,
719, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 737, 738, 745, 746)
GROUP BY sID1, sID2, sID3
HAVING COUNT(*)>1

ok this seems to work but i still need to check 100%

i dont think this is the best way

lorraine1000
Reply With Quote  
Join Date: Aug 2006
Posts: 9
Reputation: lorraine1000 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lorraine1000 lorraine1000 is offline Offline
Newbie Poster

Re: duplicate rows

  #12  
Aug 2nd, 2006
hollystyles i want to thank you for all your help

lorraine1000
Reply With Quote  
Join Date: Feb 2005
Location: Braintree, UK
Posts: 1,161
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Rep Power: 7
Solved Threads: 58
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: duplicate rows

  #13  
Aug 2nd, 2006
That's exactly what I was going to suggest, as soon as I had established which list of items it needed to be.

The only other way is to add the list of ID's that you want into another table on their own and join on it.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote  
Join Date: Aug 2006
Posts: 9
Reputation: lorraine1000 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
lorraine1000 lorraine1000 is offline Offline
Newbie Poster

Re: duplicate rows

  #14  
Aug 2nd, 2006
i think this was the easyes way of the 2 options but it does work

thank you once again

lorraine1000
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 6:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC