March 3, 2011 at 1:03 pm
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
SELECT GUID
FROM #T
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
Thanks ColdCoffee! I think you nailed it. Your query selects all companies that never changed their name. I think I can work with that!
Thank you very much, guys!
Spoke too soon. It works for only those companies that dont have any NULLs.
March 3, 2011 at 1:03 pm
ColdCoffee (3/3/2011)
SELECT GUID
FROM #T
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
That'll get the ones that haven't changed. Change it from equals 1 to greater than 1 and you'll get the ones that have changed.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 3, 2011 at 1:07 pm
lee rite (3/3/2011)
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
SELECT GUID
FROM #T
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
Thanks ColdCoffee! I think you nailed it. Your query selects all companies that never changed their name. I think I can work with that!
Thank you very much, guys!
Spoke too soon. It works for only those companies that dont have any NULLs.
Just add a WHERE clause to remove the NULL rows! Like
SELECT GUID
FROM #T
WHERE CompanyName IS NOT NULL
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
March 3, 2011 at 1:22 pm
ColdCoffee (3/3/2011)
lee rite (3/3/2011)
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
SELECT GUID
FROM #T
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
Thanks ColdCoffee! I think you nailed it. Your query selects all companies that never changed their name. I think I can work with that!
Thank you very much, guys!
Spoke too soon. It works for only those companies that dont have any NULLs.
Just add a WHERE clause to remove the NULL rows! Like
SELECT GUID
FROM #T
WHERE CompanyName IS NOT NULL
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
Thanks again! I think I'm done! I really appreciate all the help!
March 3, 2011 at 1:26 pm
lee rite (3/3/2011)
Thanks again! I think I'm done! I really appreciate all the help!
Will i be getting a Samsung Focus for this help , mate ?? :hehe:
March 3, 2011 at 1:43 pm
ColdCoffee (3/3/2011)
lee rite (3/3/2011)
Thanks again! I think I'm done! I really appreciate all the help!Will i be getting a Samsung Focus for this help , mate ?? :hehe:
I will probably get a thank you from my manager for completing this project that I will make sure to forward to you. I will also mention to him that a lot of credit should be given to ColdCoffee. So you are getting a thank you and a recognition. Isn't it so much better than Samsung Focus? :hehe:
March 3, 2011 at 1:48 pm
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
lee rite (3/3/2011)
Thanks again! I think I'm done! I really appreciate all the help!Will i be getting a Samsung Focus for this help , mate ?? :hehe:
I will probably get a thank you from my manager for completing this project that I will make sure to forward to you. I will also mention to him that a lot of credit should be given to ColdCoffee. So you are getting a thank you and a recognition. Isn't it so much better than Samsung Focus? :hehe:
... about as much as drinking cold coffee... :w00t:
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
March 3, 2011 at 1:51 pm
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
lee rite (3/3/2011)
Thanks again! I think I'm done! I really appreciate all the help!Will i be getting a Samsung Focus for this help , mate ?? :hehe:
I will probably get a thank you from my manager for completing this project that I will make sure to forward to you. I will also mention to him that a lot of credit should be given to ColdCoffee. So you are getting a thank you and a recognition. Isn't it so much better than Samsung Focus? :hehe:
If you tell your manager that you couldn't have gotten this project done without cold coffee, he'll definitely be confused. Probably worth it for the entertainment value.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 3, 2011 at 1:55 pm
GSquared (3/3/2011)
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
lee rite (3/3/2011)
Thanks again! I think I'm done! I really appreciate all the help!Will i be getting a Samsung Focus for this help , mate ?? :hehe:
I will probably get a thank you from my manager for completing this project that I will make sure to forward to you. I will also mention to him that a lot of credit should be given to ColdCoffee. So you are getting a thank you and a recognition. Isn't it so much better than Samsung Focus? :hehe:
If you tell your manager that you couldn't have gotten this project done without cold coffee, he'll definitely be confused. Probably worth it for the entertainment value.
I have new expectations of his manager going down to the break room and cutting the plug on the coffee machine's heating plates now...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
March 3, 2011 at 1:58 pm
Craig Farrell (3/3/2011)
GSquared (3/3/2011)
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
lee rite (3/3/2011)
Thanks again! I think I'm done! I really appreciate all the help!Will i be getting a Samsung Focus for this help , mate ?? :hehe:
I will probably get a thank you from my manager for completing this project that I will make sure to forward to you. I will also mention to him that a lot of credit should be given to ColdCoffee. So you are getting a thank you and a recognition. Isn't it so much better than Samsung Focus? :hehe:
If you tell your manager that you couldn't have gotten this project done without cold coffee, he'll definitely be confused. Probably worth it for the entertainment value.
I have new expectations of his manager going down to the break room and cutting the plug on the coffee machine's heating plates now...
Haha! Maybe I shouldn't mention ColdCoffee....OR...maybe I should ask ColdCoffee to change his name to HotLunch or something like that :w00t:
March 3, 2011 at 2:22 pm
Just be glad he goes by ColdCoffee. Think how much worse it would be if you had to say the day was saved by FlatRootbeer, or SpoiledMilk.... WarmBeer might at least make more sense than those, but would raise other questions....
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 3, 2011 at 2:48 pm
Lol :w00t: !! my nickname is derived from a bitter experience by drinkng ColdCoffee, but that led to the formation of a set of close friends for me; so, me changing to HotLunch would never occur 🙂 but nonetheless, as Gus points out, Cold Coffee is much better than the Root Beers or Ginger Ales 😛 :hehe:
March 4, 2011 at 6:35 am
ColdCoffee (3/3/2011)
Lol :w00t: !! my nickname is derived from a bitter experience by drinkng ColdCoffee, but that led to the formation of a set of close friends for me; so, me changing to HotLunch would never occur 🙂 but nonetheless, as Gus points out, Cold Coffee is much better than the Root Beers or Ginger Ales 😛 :hehe:
Ah c'mon! Change it to "Steak Dinners" for a while. Then when this guy tells his boss what he needs in order to get projects done, he's got a chance at something nice! :w00t:
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
March 4, 2011 at 7:36 am
GSquared (3/4/2011)
ColdCoffee (3/3/2011)
Lol :w00t: !! my nickname is derived from a bitter experience by drinkng ColdCoffee, but that led to the formation of a set of close friends for me; so, me changing to HotLunch would never occur 🙂 but nonetheless, as Gus points out, Cold Coffee is much better than the Root Beers or Ginger Ales 😛 :hehe:Ah c'mon! Change it to "Steak Dinners" for a while. Then when this guy tells his boss what he needs in order to get projects done, he's got a chance at something nice! :w00t:
Or at least to "WellDeservedRaiseandBonus"
Viewing 14 posts - 16 through 29 (of 29 total)
You must be logged in to reply to this topic. Login to reply