Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Get multiple rows of data based on one condition and grouping


Get multiple rows of data based on one condition and grouping

Author
Message
ScottPletcher
ScottPletcher
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4411 Visits: 6833
Eugene Elutin (10/2/2012)

...
Given that a customer's name can change, perhaps it is an attribute of the purchase.
...


Given that nothing in the Universe is constant and everything can change, I would suggest to have one table CustomerPurchase and make all attributes to be attributes of purchase...
Hehe

It's right for pointer to customer address and price to be attributes of the purchase. But,
it is wrong for customer name. Even if customer name has changed, you will most likely want to see and report all existing purchases with the new name not he old one, until you want datawarehouse changing dimension.



For, say, medical implants and gun sales, to pick just two, is it legal for you not to know the name you sold to?? Just asking. I worked at a medical implant device maker and the FDA was very, very strict on what records had to be kept.

SQL DBA,SQL Server MVP('07, '08, '09)

Prosecutor James Blackburn, in closing argument in the "Fatal Vision" murders trial: "If in the future, you should cry a tear, cry one for them [the murder victims]. If in the future, you should say a prayer, say one for them. And if in the future, you should light a candle, light one for them."
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search