Viewing 15 posts - 3,271 through 3,285 (of 3,957 total)
Evil Kraig F (6/27/2012)
achen9291 (6/27/2012)
I would have to say the first option. Multiple datasets. I'm confused myself :/
Alright, it's not pretty but if you actually need multiple unique datasets returned...
June 27, 2012 at 11:11 pm
MyStr, MyStr1 and MyStr2 in my version are just the names of the computed fields which you can substitute for your actual column as needed.
June 27, 2012 at 11:04 pm
I'm not GSquared (nor do I pretend to be), but this may work for you:
;WITH TestData (MyStr) AS (
SELECT '\Big_Fam_Beverages\Soda Pop\Mountain Dew'
UNION ALL SELECT '\Lcal_Beverages\Soda Pop'
UNION ALL SELECT...
June 27, 2012 at 10:16 pm
I like this problem and wanted to contribute. Alas my query contribution (as follows) barks like the dog that it is.
;WITH Booking AS (
SELECT ID,...
June 27, 2012 at 8:05 pm
But if you're wedded to CASE you can do it like this:
SELECT @CMD=
case
when @model = 'Global' then
'SELECT '+@model+' AS Model
, Scenario_ID
FROM lp_Scenario AS a'
Else
'SELECT '+@model+' AS Model
, a.Scenario_ID
,...
June 27, 2012 at 7:18 pm
dwilliscp (6/27/2012)
June 27, 2012 at 7:08 pm
tinausa (6/27/2012)
[id] [subid] [pct]
abc w 10
abc e 20
abc g ...
June 27, 2012 at 6:40 pm
Jeff Moden (6/27/2012)
Ya know what I REALLY like about smart-phones, iPads, and the like? I don't have one and don't need one. 🙂
Amen(!) to that.
June 27, 2012 at 6:31 pm
Les Cardwell (6/27/2012)
Dwain,Since #1 is not unique, unless I misunderstood, it shouldn't be included. Only 2, 3, 4 are unique in the set.
~Les
Hmmm. Must've missed that. So then...
June 27, 2012 at 6:29 pm
Les Cardwell (6/27/2012)
I must be doing something wrong here. I'm using the CTE to attempt the same logic as SW7 to resolve those new Sweden districts with two old districts...
June 27, 2012 at 6:19 pm
Have you tried removing dbs.DBAvailMB from the GROUP BY?
June 27, 2012 at 7:09 am
Use GROUP BY on SQL Server and App name fields and SUM the fields you want to add up.
June 26, 2012 at 10:29 pm
I am not sure why you're thinking UNION ALL.
All you need to do is replace SampleData after FROM in Chris's query with your table name (and get rid of his...
June 26, 2012 at 10:27 pm
Chris has parsed the availability date only for you.
You'd need to apply the CHARINDEX steps to parse out the other fields you need from the InputString in a similar fashion.
His...
June 26, 2012 at 10:10 pm
My expectation was that Chris's query would be faster. Shall we check?
Test harness (5000 rows):
SET STATISTICS TIME ON
;WITH Tally AS (
SELECT TOP 1000 n=ROW_NUMBER() OVER...
June 26, 2012 at 9:52 pm
Viewing 15 posts - 3,271 through 3,285 (of 3,957 total)