Viewing 15 posts - 1,231 through 1,245 (of 8,416 total)
L' Eomot Inversé (1/11/2012)
Nice and simple.
I see a lot of people saying this, but either my product knowledge is significantly below average or we're doing something differently. I don't,...
January 11, 2012 at 6:55 am
apatel 80451 (1/11/2012) via private message
The query works thanks. But I need to include the middle column and this doesnt seem to work in the grouping?
If you are using SQL...
January 11, 2012 at 3:34 am
ananda.murugesan (1/11/2012)
Resolved this error- This can be done by following the menu route: Edit -> IntelliSense -> Refresh Local Cache
Ctrl-Shift-R is the keyboard shortcut. I'm intrigued though: you said,...
January 11, 2012 at 3:22 am
Mark-101232 (1/11/2012)
Something like this?
WITH CTE AS (
SELECT [User],GWP,
ROW_NUMBER() OVER(PARTITION BY [User] ORDER BY GWP DESC) AS rn
FROM MyTable)
SELECT [User],GWP
FROM CTE
WHERE rn=1;
Or...
SELECT
...
January 11, 2012 at 2:49 am
Jnrstevej (1/11/2012)
Sorry ignore my last comment i was reviewing it in 'Results to Grid' instead of 'Results to Text'
People generally use a fixed-width font in both Grid and Text output...
January 11, 2012 at 2:46 am
apatel 80451 (1/11/2012)
Apologies forget to say how I could group the distinct users and there top GWP?
Which column is GWP (I have no idea what GWP is by the way)?...
January 11, 2012 at 2:19 am
apatel 80451 (1/11/2012)
I have the following data:User
Salesperson A23171320230.00
Salesperson B11782199584.00
Salesperson C1676914437175.00
Salesperson D17191-635580.00
Salesperson A16844122000.00
Salesperson B18708159775.00
Salesperson D10969225295.00
Salesperson C1868173040.00
Salesperson D26480768201.00
Salesperson A10310-111325.00
Salesperson B17291-460550.00
Salesperson B11116323329.00
Salesperson E19162-65940.00
Salesperson C11224947025.00
Salesperson A1056873040.00
Did you have a question?
January 11, 2012 at 2:15 am
The problem is your DATETIME columns contain a date part as well as a time. When you write "time_out <= '9:30 am'" (with no date specified), SQL Server uses...
January 11, 2012 at 1:31 am
Just for interest, this can be written using the (now deprecated) GROUP BY ALL syntax. This example shows the equivalent query with and without using GROUP BY ALL:
DECLARE @Example...
January 11, 2012 at 1:06 am
Lynn Pettis (1/10/2012)
How about saving your actual execution plan and uploading it to this thread? That would help us a lot.
The execution plan looks like this:
An example actual execution...
January 10, 2012 at 11:52 pm
nirnaykhatri (1/10/2012)
What does SQL Server do in Segment and Sequence Project? I mean what happens internally to give the result?
I wrote about the internals of Segment and Sequence Project here:
You...
January 10, 2012 at 11:46 pm
It's even simpler than that:
DECLARE @Vendor varchar(7) = '1001'
SELECT
'PL06' + CONVERT(char(7), @Vendor) + '_1002'
Result:
PL061001 _1002
January 10, 2012 at 11:41 pm
I would also prefer an APPLY based solution. Using AdventureWorks:
WITH
Data AS
(
SELECT
...
January 10, 2012 at 11:34 pm
Cadavre (1/10/2012)
January 10, 2012 at 11:12 pm
tfifield (1/10/2012)
January 10, 2012 at 6:06 pm
Viewing 15 posts - 1,231 through 1,245 (of 8,416 total)