Forum Replies Created

Viewing 15 posts - 61 through 75 (of 760 total)

  • RE: Generate all possible number combinations for a provided list of numbers

    This is a slightly long approach.....but this is one way you can do it :

    ;With CTE

    As

    (

    Select 1 As Number Union Select 2Union Select 3 Union Select 4

    ),...

  • RE: How do i line up the weeks in T-SQL ?

    May be this is what you are looking for:

    ;With CTE

    As

    (

    SELECT DISTINCT 'International' Campus,28 'Weeks-2013',0 'Weeks-2012',2 'Student-2013',0 'Student-2012',0 StudentPrevYrTotal

    UNION

    SELECT DISTINCT 'International' Campus,32 'Weeks-2013',0 'Weeks-2012',1 'Student-2013',0 'Student-2012',0 StudentPrevYrTotal

    UNION

    SELECT DISTINCT 'International'...

  • RE: Return 1 record with data from multiple tables

    Jeff Moden (3/30/2013)


    vinu512 (3/28/2013)


    This is how you can transform Mickey's query into a Dynamic Cross tab:

    Declare @sql Varchar(MAX)

    -- Set up some test data

    Create table product(ProductId Int, ProductName Varchar(30),CategoryID...

  • RE: Return 1 record with data from multiple tables

    This is how you can transform Mickey's query into a Dynamic Cross tab:

    Declare @sql Varchar(MAX)

    -- Set up some test data

    Create table product(ProductId Int, ProductName Varchar(30),CategoryID Int)

    Create table category(CategoryID...

  • RE: Return 1 record with data from multiple tables

    mickyT (3/25/2013)


    You could do something like the following, if you will always have 2 product prices, with 1 that has a quantity of 1.

    select ProductID, ProductName, CategoryID, CategoryName, pp1.ProductQuantity, pp1.ProductCost,...

  • RE: Reorder a custom order column

    Cab you please be more precise on the logic behind the ordering.....If you simply want to

    move and earlier number to a later number

    then there can be a no....

  • RE: remove duplicates IF matches

    Good job with the DDL and the required output, we are only missing the sample data now.....take your time and make a dummy sample data set that looks like or...

  • RE: SubQuery

    The option is wrong....it is not necessary to have an Order By clause if Top is specified in a query.....it should be other way round.....Order By can only be specified...

  • RE: remove duplicates IF matches

    Brad Marsh (3/7/2013)


    Thanks Lynn I can appreciate what your saying but the reason I gave you that dummy data is because the data is confidential, I can not simply throw...

  • RE: remove duplicates IF matches

    Let me get this right....from what i understood....a user may have umpteen no. of comments and the comments could all b different so you cant group using the comments column....

  • RE: remove duplicates IF matches

    Brad Marsh (3/6/2013)


    Thanks all, I really should have been clearer. The data is very much dynamic I can't predict what to expect from the comments. I was giving you a...

  • RE: remove duplicates IF matches

    Oh shoot!!!...so much for typing so much 😀

    Lynn posted while I was typing....

  • RE: remove duplicates IF matches

    Hello,

    Since you have 20 points, I assume that you are not new here have a relative idea about posting data on forums. If you don't then there is a...

  • RE: Index Selection in SQL Server

    Thanks Jason and Grant.

    I did have a look at Sql Server Internals and even placed an order for it with Amazon. 😉

    Till then I downloaded the ebook of...

  • RE: Index Selection in SQL Server

    GilaMonster (2/27/2013)


    vinu512 (2/27/2013)


    Something that helped you in learning about this when you started.......would be great.

    I learnt mostly by write query, run query, analyse exec plan.

    I am pretty much...

Viewing 15 posts - 61 through 75 (of 760 total)