Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 8,416 total)

  • RE: Checking database access

    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,...

  • RE: Grouping

    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...

  • RE: invalid object name after creating table?

    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,...

  • RE: Grouping

    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

    ...

  • RE: How to add spaces to attribute based on the number of characters

    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...

  • RE: Grouping

    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)?...

  • RE: Grouping

    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?

  • RE: query using time

    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...

  • RE: Count fields that do not meet specified condition

    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...

  • RE: Execution Plan

    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...

  • RE: Execution Plan

    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:

    http://sqlblog.com/blogs/paul_white/archive/2010/07/28/the-segment-and-sequence-project-iterators.aspx

    You...

  • RE: How to add spaces to attribute based on the number of characters

    It's even simpler than that:

    DECLARE @Vendor varchar(7) = '1001'

    SELECT

    'PL06' + CONVERT(char(7), @Vendor) + '_1002'

    Result:

    PL061001 _1002

  • RE: Selecting TOP PERCENT based on GROUP ?

    I would also prefer an APPLY based solution. Using AdventureWorks:

    WITH

    Data AS

    (

    SELECT

    ...

  • RE: search second value from comma separated string

    Cadavre (1/10/2012)


    I can't remember whether or not Jeff Moden's string splitter[/url] already does that, or if I had to edit it but I do know that the TALLY table method...

  • RE: Combine different periods into one

    tfifield (1/10/2012)


    I would never have considered using actual columns from a table in a VALUES clause. Great little nugget there! I guess I need to think more outside...

Viewing 15 posts - 1,231 through 1,245 (of 8,416 total)