Forum Replies Created

Viewing 15 posts - 406 through 420 (of 475 total)

  • RE: Why does this get me multiple records?

    Hi Sean

    The MAX is applied to each group and since the auditdate column is in the GROUP BY clause you will get a group for each auditdate. This means...

  • RE: Puzzle / CTE Help - NO CURORS :)

    Hi

    Here's something that may work, I still need to test it over a larger set of data.

    It uses quirky updates and I haven't done a lot with these, so I...

  • RE: export table with a geometry column

    Hi

    Unfortunately you are probably going to have to use some sort of workaround to solve this issue.

    Another method would be to export a query rather than the table and cast...

  • RE: The Lonely and Neglected Cartesian Product (Cross Join)

    Thanks for the question and the nice explanation

  • RE: Change value of column in last row when doing insert

    Hi

    You could try the following

    INSERT INTO #tblTasks

    SELECT TaskID,

    Task,

    CASE

    WHEN ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) = COUNT(*) OVER (PARTITION BY (SELECT NULL)) THEN 1

    ELSE 0

    END LastOne

    FROM tblOldTasks

    This assumes that...

  • RE: Query Help

    Hi

    It would probably be best to post some sample data with an example of what you require, however I'll take a stab at what I think you are trying to...

  • RE: Convert varbinary to integers and insert

    Hi

    Not sure if this will help, but the following example packs a couple of varbinarys with 4 integers in both endians (assuming 4 bytes per integer). Then unpacks them....

  • RE: Replace function... is it possible?

    No problem,

    I'll have to remember that 🙂 I don't use FOR XML much, but it is useful occasionally

  • RE: Replace function... is it possible?

    There are probably better people to replay to this than me, but I would say that you need to make this a subquery and alias the result from that. ...

  • RE: Split String into 3 parts with a twist!

    No problem and you're welcome

  • RE: Split String into 3 parts with a twist!

    Hi

    This isn't exactly pretty ... but it's another way to skin the cat

    ;with cteOriginal (CompanyName, CompName1, CompName2, CompName3)

    as

    (

    select 'A V H S L ALQUILER Y VENTA DE HOGARES', NULL, NULL,...

  • RE: identity table use case

    Hi

    Without the GO 3 and using either values or select

    create table N (i int not null identity(100,1) constraint PK_ primary key,test bit);

    create table #tmp (i int not null primary key);

    GO

    --...

  • RE: max of sums with cte?

    Hi

    I think something like this may do what you want.

    ;with countbyuserday as (

    SELECT userid, recorddate, count(*) numrec

    FROM [#tasks_log]

    GROUP BY userid, recorddate

    ),

    seqbymaxnum as (

    SELECT userid, recorddate, numrec, ROW_NUMBER() OVER (PARTITION BY...

  • RE: Nested replaces ?

    Abu Dina (1/28/2013)


    Thanks Chris.

    But this is removing words like 'TO' from TOWER and 'EL from HOTEL etc...

    That makes it tricky ... as you need to start looking for word bounds....

  • RE: CHOOSE - 1

    I'm guessing that since Fall is returning as least hires, that you need to have adventureworks to be able to answer this question correctly.

Viewing 15 posts - 406 through 420 (of 475 total)