Viewing 15 posts - 691 through 705 (of 5,504 total)
Why does the result set only show data for vendor_id = 15?
It looks like the second result set is either a repetition of previous columns or an aggregation. In...
January 10, 2012 at 3:47 pm
GilaMonster (1/10/2012)
SQLKnowItAll (1/10/2012)
mdonald 98074 (1/10/2012)
January 10, 2012 at 3:27 pm
still not clear. Please provide the expected output in a readable format (not mangled by the code mystiprettifier)
January 10, 2012 at 3:22 pm
Why don't you tell us what you think and why you think the questions are tricky and/or what your answer would be?
I think it's fair enough to have a discussion...
January 10, 2012 at 3:17 pm
On some questions the answer would be "E: none of the above / it depends" (or C, respectively)
January 10, 2012 at 3:04 pm
Very nice sample data but the expected result is anything but clear.
Can you post in a different way what you're looking for? (maybe even attaching a jpeg)
And if the expected...
January 10, 2012 at 2:59 pm
Please take the time to read and follow the advice given in the first article referenced in my signature and provide some ready to use sample data.
Furthermore I'd like to...
January 10, 2012 at 2:06 pm
Something like this?
SELECT TOP 1 xyz FROM table1 ORDER BY xyz DESC
January 10, 2012 at 1:42 pm
xiaoxiaoli72 (1/10/2012)
January 10, 2012 at 11:30 am
royce.bacon (1/10/2012)
January 10, 2012 at 11:24 am
Bob Cullen-434885 (1/10/2012)
I don't know if it matters, but Paul's solution doesn't quite do what you specified, as it doesn't return data for the last date in the report...
January 10, 2012 at 10:24 am
Ninja's_RGR'us (1/10/2012)
January 10, 2012 at 9:34 am
Well, from 600 rows in 5hrs to 4366 rows in 4 sec is quite an improvement!!
Thank you for posting the result!
And again, I'm sorry for not detecting the .query issue...
January 10, 2012 at 9:09 am
And here's the CrossTab solution I had in mind:
;
WITH cte AS
(
SELECT
ProductId,
Picture,
ROW_NUMBER() OVER(PARTITION BY ProductId ORDER BY Picture ) AS row
FROM @table2
)
SELECT
t1.ProductId,
t1.SKU,
t1.[Description],
MAX(CASE WHEN t2.row=1 THEN t2.Picture...
January 10, 2012 at 9:02 am
Join the two tables and pivot the data using the CrossTab method as described in the related link in my signature should do the trick.
January 9, 2012 at 4:54 pm
Viewing 15 posts - 691 through 705 (of 5,504 total)