Forum Replies Created

Viewing 15 posts - 16 through 30 (of 86 total)

  • RE: Need Query for calculation total

    yuvipoy (5/20/2014)


    vignesh.ms (5/20/2014)


    Hi there,

    here is the sample

    create table Sample (id int ,value int,total int)

    insert into Sample (id,value) values (1,1)

    insert into Sample (id,value) values (1,4)

    insert into Sample (id,value)...

  • RE: Need Assistance for Groups and Islands Problem

    ChrisM@Work (4/30/2014)


    Please provide some realistic sample data so that folks attempting to help won't have the same problem.

    Table structure is same... Data only differs

    It will always starts and...

  • RE: Need Query for Problem

    this is not the fine answer & also not mine...

    It took much time to solve 1000 , so given answer is for 100

    WITH Base(N) AS(

    SELECT 1 UNION...

  • RE: Need Query for Problem

    LutzM (4/19/2014)


    Your question is "Need query for problem".

    Would you mind sharing the logic you came up with to solve the problem? We might be able to help you "translate" it...

  • RE: Need Query for Problem

    Louis Hillebrand (4/18/2014)


    This looks me as a homework job, so the OP has to find the solution, that's why I didn't give the query,

    Just a hint: Min quantity = 1,...

  • RE: Need Query for Problem

    J Livingston SQL (4/18/2014)


    vignesh.ms (4/18/2014)


    Brandie Tarvin (4/18/2014)


    This sounds like a contest or homework problem to me.

    Should be mixture of all products..

    I'm eagerly waiting for the query....

    Pls try it out..

    ok...here is...

  • RE: Need Query for Problem

    This is an EXTREMELY complex algorithm. It is similar to the bin packing problem. Both of these are incredibly complex mathematical calculations. Did you even use google as Dwain suggested?...

  • RE: Need Query for Problem

    Brandie Tarvin (4/18/2014)


    This sounds like a contest or homework problem to me.

    Should be mixture of all products..

    I'm eagerly waiting for the query....

    Pls try it out..

  • RE: Need Query for Problem

    Any help ??

  • RE: Need Query for Groups and Islands Problem

    Hello all,

    I myself prepared query for the above scenario...

    But have some deviation...

    I could not able to retrieve last row in the given output

    ;with cte as (

    select ROW_NUMBER() over(order...

  • RE: Need Query for summarizing data

    higgim (4/9/2014)


    By no means elegant and I have not tested this with any other data than what you have provided but it does give you the expected results based on...

  • RE: Need Query for summarizing data

    higgim (4/9/2014)


    I have had a quick look at this and need to ask:

    Your desired output

    YYY Ret1 35

    YYY 25

    Where...

  • RE: Need Query for summarizing data

    Anybody help ??

  • RE: How to run dynamic query which is the output of another query ?

    Luis Cazares (3/21/2014)


    Assign it to a variable and execute the variable with sp_executesql or EXEC().

    how to assign all at once ?

  • RE: Need Query for Problem

    whenriksen (3/20/2014)


    SELECT * ,

    MaxUnits = CONVERT(INT, 1000 / CONVERT(DECIMAL(5), Price))

    FROM #sample

    We should combine all the products in...

Viewing 15 posts - 16 through 30 (of 86 total)