Forum Replies Created

Viewing 15 posts - 6,976 through 6,990 (of 15,381 total)

  • RE: Help with this query please.

    xRafo (8/29/2013)


    ok I get it on the NOLOCK. Thanks.

    @Alan.B

    your query give me this error:

    Invalid object name 'Estimated'. 🙁

    That is because he missed that you had a cte named estimated. The...

  • RE: How to Fatch last maximum non-zero values

    Koen Verbeeck (8/29/2013)


    Sean Lange (8/29/2013)


    Koen Verbeeck (8/29/2013)


    WITH CTE_NoZero AS

    (SELECT ID, ReadNo, deviceNo FROM DeviceReading WHERE ReadNo <> 0)

    SELECT ReadNo, deviceNo

    FROM

    (SELECT ReadNo, deviceNo, RID = ROW_NUMBER() OVER (PARTITION BY deviceNo ORDER...

  • RE: How to find orders that contain the same product

    Coriolan (8/29/2013)


    Jeff,

    I am not sure why the question was about CSV format? My question is to get a comma delimited string as output.

    CSV = Comma Separated Values. 😀

  • RE: How to Split String

    Stylez (8/29/2013)


    Select engine From Units Where UnitNumber = '170272'

    Result:

    engine

    ------------

    CAT C-15

    What i Want to Achieve:

    select MFGCODE,model from UASSEM where UNITID = '170272'

    MFGCODE ...

  • RE: How to Fatch last maximum non-zero values

    Koen Verbeeck (8/29/2013)


    WITH CTE_NoZero AS

    (SELECT ID, ReadNo, deviceNo FROM DeviceReading WHERE ReadNo <> 0)

    SELECT ReadNo, deviceNo

    FROM

    (SELECT ReadNo, deviceNo, RID = ROW_NUMBER() OVER (PARTITION BY deviceNo ORDER BY ID DESC)

    FROM CTE_NoZero)...

  • RE: How to Split String

    Stylez (8/29/2013)


    Hi Guys,

    I would need to run the function across a querry that returns more than one values

    do i need to create a cursor for this to be able...

  • RE: How to Split String

    Stylez (8/29/2013)


    Good Afternoon Guys,

    The EngineMakeModel is The Raw Column that is not Yet Concatenated and would need to be split into th

    EngineMake Columnd and Model Column Separately. The Input would...

  • RE: How to Split String

    Stylez (8/29/2013)


    SELECTLEFT(EngineMakeAndModel,CHARINDEX(' ',EngineMakeAndModel)),

    RIGHT(EngineMakeAndModel,LEN(EngineMakeAndModel)-CHARINDEX(' ',EngineMakeAndModel))

    FROM

    (values('engines')) as x(select engine from units)

    can i do the one above?

    I want the Input to come from the Select Statement i have provided

    Much Thanks

    Noel

    The reason I...

  • RE: How to Split String

    Alan.B (8/29/2013)


    Sean Lange (8/29/2013)


    Alan.B (8/29/2013)


    The correct way to split a string using T-SQL would be to use Jeff's splitter as Louis mentioned. That said, what you are doing is quite...

  • RE: How to Fatch last maximum non-zero values

    What you posted is not really sample data. It is text that sort of is like sample data.

    It looks like you pretty much wrote the query in your explanation...group...

  • RE: How to Split String

    Alan.B (8/29/2013)


    The correct way to split a string using T-SQL would be to use Jeff's splitter as Louis mentioned. That said, what you are doing is quite simple; you could...

  • RE: Help with this query please.

    Actually the OP is doing a recursive cte. The cte is named Estimate and the second half joins to it.

    You will probably have to use your cte to return the...

  • RE: How to Split String

    If your actual data is as simple as the one example you could also use PARSENAME.

    select PARSENAME(replace(EngineMakeAndModel, ' ', '.'), 2), PARSENAME(replace(EngineMakeAndModel, ' ', '.'), 1)

    from (values('PeterBilt MT20100')) as x(EngineMakeAndModel)

  • RE: Curious thought on how to approach making a query like this "better'

    You are welcome for the links. I keep them handy. 😉

    I don't envy you in trying to clean this one up. It is a long and painful road for sure....

  • RE: sp_getrecords to get all records from a table

    saravanakumar.G (8/28/2013)


    Hi,

    Thanks for the reply.

    Yes. the SP is working if we put single quotes across the tablename ('schemaname.tablename').

    I want to try whether is...

Viewing 15 posts - 6,976 through 6,990 (of 15,381 total)