473,322 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Comparing "Sets" of int`s in SQL Server 2005

Hello,
Since a while i have to find a way of comparing "Sets" (multiple int Values) and so to find equal sets. There simply 3 tables

ValueList with: ID int
ValueListHasValue: ID int, ValueListID int, ValueID int
Value: ID int, Description varchar(max)

The sets are defined in the ValueList has ValueTable. Any combination and order is possible as there is also no restriction on the amount of Values in a ValueList. My first approach was to use CTE and Checksum_AGG

Expand|Select|Wrap|Line Numbers
  1. ;WITH CTE1(ValueListID, chksum) AS
  2. (
  3. Select ValueListId, CHECKSUM_AGG(CHECKSUM(ValueListHasValue.ValueId)) from ValueListHasValue
  4. Group By ValueListId
  5. ),
  6. CTE2(ValueListID, chksum) AS
  7. (
  8. Select varValueList.ValueListId, CHECKSUM_AGG(CHECKSUM(varValueList.ValueId)) from @VarValueList varValueList
  9. Group By ValueListId
  10. )
  11.  Select CTE1.ValueListId from CTE1,CTE2 where CTE2.chksum = CTE1.chksum
  12.  
But CHECKSUM_AGG isnt always correct (as actually said in the Help). So that i sometimes dont receive a set if i have a temporarry set for wich i need find out if an equal set exists.

Does anybody has a buzzwrd for me to start googling or perhaps a solution for this?
Mar 10 '08 #1
0 957

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: glakk | last post by:
I want to build an application that would let people search records of content, based on keywords. The content record table would have a field called 'tags' which would be a comma-seperated string...
22
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html ...
23
by: Hans | last post by:
Hello, Why all C/C++ guys write: const char* str = "Hello"; or const char str = "Hello";
41
by: Odd-R. | last post by:
I have to lists, A and B, that may, or may not be equal. If they are not identical, I want the output to be three new lists, X,Y and Z where X has all the elements that are in A, but not in B, and...
1
by: Jay | last post by:
I'm installing one of my dlls to the GAC but no matter what attribute I try, the name that shows up in explorer under global assembly name is always just the name of my assembly file. Is there a...
19
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor =...
42
by: Paul | last post by:
Anyone know where I can find some good resources to help us choose between SQL and Oracle ( Progress Openedge as well ) . Any comments on what you would choose ?? We are creating a new Warehouse...
7
by: Erik Funkenbusch | last post by:
I've been thinking about different ways to address this problem, and I figured i'd just toss this out and see if anyone has a good solution. I've got database field of type char(1), this field...
9
by: Beowulf | last post by:
I was having this problem: http://groups.google.com/group/microsoft.public.sqlserver.server/msg/e36e423972323378?dmode=source with it taking an inordinate amount of time to enumerate the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.