Viewing 15 posts - 30,541 through 30,555 (of 59,101 total)
codebyo (3/29/2012)
SELECT
CustomerId
FROM Purchase
WHERE ProductCode IN ('A','B', 'C')
GROUP BY CustomerID
having sum(case when ProductCode = 'A' then 1 else 0 end) > 0
and sum(case when ProductCode...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 6:22 pm
venoym (3/29/2012)
I haven't tested the performance as I don't have a setup to do that,
Heh... sure you do. I mentioned that I attached code to the million row setup...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 6:11 pm
Wavesailor (3/29/2012)
In MySQL 😀 this is the fastest by far:
SELECT
CustomerId
FROM Purchase
WHERE ProductCode IN ('A','B', 'C')
GROUP BY CustomerID
having sum(case...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 6:09 pm
James Dingle-651585 (3/29/2012)
Comparing syntax without an idea of the performance signature is a bit useless IMHO.
I'm 100% in agreement with you. That's why I stated the following in the...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 5:57 pm
Toby Harman (3/29/2012)
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 5:46 pm
Arjun S (3/28/2012)
--===== Find Customers that bought both...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 5:33 pm
mark hutchinson (3/28/2012)
Did you compare the speed of this query against one where your first (Group By) From clause is a Select Distinct (sub) query?
Nice article. It builds nicely...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 5:15 pm
Just my 2 cents and to reiterate some of what has already been said. Yes, they should tell you... but you shouldn't count on it. It should be...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 3:51 pm
Are you all set then or do you still need some help to pull all of this off?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 7:35 am
dwain.c (3/26/2012)
Perhaps I didn't adapt your code properly to my temporary table. Can you tell me what I did wrong?
Sorry. Lost track of this post in all the...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 6:49 am
Eugene Elutin (3/29/2012)
What I can say, crap data structure design quickly leads to crap and stupid coding you need to do to achieve something good!...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 6:46 am
Hi folks,
Thanks for the great discussion going on and the thoughtful feedback. I'd love to jump in this instant but I'm on my way to work. I'll be...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 6:34 am
pdiagne83 (3/27/2012)
THANK youCan I get the result with PIVOT ?
Just double checking... you want the result in separate columns instead of concatenated into one column, correct?.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 29, 2012 at 6:22 am
p.s. Almost forgot. Don't forget to add the month and year to your SELECT list if you want to actually show groupings by month and year. After...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 28, 2012 at 8:23 pm
MyDoggieJessie (3/27/2012)
With using the CTE's that GSquared...
--Jeff Moden
Change is inevitable... Change for the better is not.
March 28, 2012 at 8:06 pm
Viewing 15 posts - 30,541 through 30,555 (of 59,101 total)