Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2007-02-28 : 08:08:45
|
Paul writes "HelloI've got a really complicated query to do and wonder if you can help me...The main table is called "Transaction" - this contains a transaction id and a referenceeach transaction has many (0 - unlimited) attributes associated with it:Attribute(AttributeTypeId, AttributeName)So....For "Transaction 1" it has:Attribute: 1, RedAttribute: 2, MediumFor "Transaction 2" it has:Attribute: 1, BlueAttribute: 2, Medium- in the real database each Transaction commonly has about 10 attributes, but could have as many as it needs (which is why we've done it like this)The problem that I've got is how do I filter on the attributes?So...Filter: Red/Medium - returns Transaction 1Filter: Blue/Medium - returns Transaction 2Filter: Medium - returns Transaction 1 & 2--- but I don't know how to do that, are you able to help?Over time, the database is going to grow to millions of transactions (literally)...so somehow it needs to be actually as efficient as possible, that's the main worry (apart from actually being able to do it in the first place!!)I really look forward to your reply!!Many thanks, Paul" |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-28 : 08:13:18
|
How do you connect attributes to transactions?Peter LarssonHelsingborg, Sweden |
 |
|
rlaubert
Yak Posting Veteran
96 Posts |
Posted - 2007-02-28 : 16:18:00
|
Are these attributes always in the same order? Is this a commercial app or custom designed?Raymond LaubertMCDBA, MCITP:Administration, MCT |
 |
|
|
|
|
|
|