Forum Replies Created

Viewing 15 posts - 1,921 through 1,935 (of 10,144 total)

  • RE: How can I pivot this rows

    You'll get a really quick response if you change this:

    rn CustomerID City Amount nCount

    1 102996 Berlin 675.00 3

    2 102996 Magdeburg 288.00 2

    3 102996 Bielefeld 268.00 2

    into...

  • RE: 4 Queries Required Very Urgent

    J Livingston SQL (11/12/2015)


    homework I assume?

    have you actually set up some sample tables and data and run your answers to see if they are correct?

    or are you looking for any...

  • RE: Delete using MERGE

    Sure. Try this:

    CREATE TABLE #Audit2 (RowID INT IDENTITY(1,1), CustomerID INT, [Action] CHAR(1), oldValue INT, newValue INT NULL) ;

    CREATE TABLE #Trans2 (CustomerID INT, Value INT);

    INSERT #Trans2 VALUES (1,100), (2,200), (3,300), (4,400),...

  • RE: Delete using MERGE

    oradbguru (11/11/2015)


    The merge would be based on a single unique id. I am deleting millions of records from a table that has 150+ million records in it. This...

  • RE: Need help finding one set of data within another set of data for update

    Also late to the party; have you considered stripping the odd text elements out of the column to leave the city name? You'd want to do this as a one-off.

    DROP...

  • RE: SQL Column update with comparison with another table

    Your code looks ok. What datatype is dbo.R_ResrvStock.Vin?

  • RE: Select case - using "in" instead of "="

    daliborh (11/10/2015)


    Ok guys, going nuts here.

    Let me explain the aim here:

    What I'm trying to accomplish is,

    make sql select values '01x', '02x' in line "and left(i.itemID,3) in

    based on the...

  • RE: Get FirstDate and LastDate of Every month from two Dates

    david.fundakowski (11/9/2015)


    I would go with a simple recursive statement.

    DECLARE @dateone AS DATE = '2012-01-01'

    DECLARE @datetwo AS DATE = '2015-04-12'

    ;WITH cte AS (

    SELECT 1 AS month_

    UNION ALL

    SELECT 1+ month_...

  • RE: Group by + Count + Case

    saregama (11/9/2015)


    Can you please help me here to write sql query on a table with below values to get desired output only using groupby and count and Case statement.

    Table -...

  • RE: Get FirstDate and LastDate of Every month from two Dates

    Why write a slow unwieldy multi-statement table-valued function when an inline table-valued function will do?

    DECLARE

    @StartDate DATE = '05/02/2015',

    @EndDate DATE = '11/25/2015'

    SELECT

    ID = n+1,

    FirstDate = DATEADD(MONTH,n,...

  • RE: In vs Outer Join

    farax_x (11/9/2015)


    I want to compare two tables via liked server (number of records which exists only in dbo.Token)

    SELECT COUNT(1)

    FROM dbo.Token TD WITH ( NOLOCK )

    WHERE ...

  • RE: DateAdd overflow using Numbers Table

    ArcticEd32 (11/5/2015)


    Thanks to all for the replies

    kaj (11/5/2015)


    The only thing I can think of that would cause this is if you have an unordered table, where n in one of...

  • RE: TREATMENT GAPS OF 2 OR MORE DAYS USING SERVICE DATES

    Mick Lovell (11/5/2015)


    1. The field I'm using for service date is a datetime. They all appear to have '12:00:00 AM' as the TIME for each service date.

    2. I am...

  • RE: TREATMENT GAPS OF 2 OR MORE DAYS USING SERVICE DATES

    Do any of the dates have times?

    Do you have multiple visits on the same day?

    Is there another column which would distinguish between two people with the same name?

  • RE: Are the posted questions getting worse?

    yb751 (11/5/2015)


    Brandie Tarvin (11/5/2015)


    At risk of being lynched: Crystal Reports is probably the easiest ad-hoc reporting tool a user with no experience can learn to use.

    Well I agree with you...

Viewing 15 posts - 1,921 through 1,935 (of 10,144 total)