Forum Replies Created

Viewing 15 posts - 1,141 through 1,155 (of 3,957 total)

  • RE: Subqueries

    T.Ashish (11/11/2013)


    May be he want to learn about sub-queries.

    Good point! In that case, I suggest to check here:

    http://beginner-sql-tutorial.com/sql-subquery.htm

  • RE: Insert Rows from excel file

    Consider using OPENROWSET. The exact query you'd need depends on some factors like what version of Excel workbook you are using.

  • RE: Summary, Rollup, Summation.

    Odd problem. If you didn't say "this table is huge" to throw me off the scent, I'd say it looks like homework.

    WITH SampleData (FormKey,Flag1,Flag2,Flag3) AS

    (

    SELECT...

  • RE: identifying many to many relationship between columns

    PL is probably correct in the way this should be handled from a theoretical perspective.

    On the other hand, this may work but also may not be particularly performant.

    DECLARE @T1 TABLE...

  • RE: sql query for ssrs report

    SqlServerNinja (11/11/2013)


    The tables I have are as follows :

    Store :

    YEAR MONTH StoreName

    2013 10 ABC

    2013 10 DEF

    2013...

  • RE: Criteria Table

    I think that you'll probably be able to get a better answer if you provide some additional information:

    - DDL (CREATE TABLE) for your source table

    - INSERT statement(s) to populate the...

  • RE: Return the last version of set of records

    Nadrek (11/11/2013)


    As the above posters have said, it's essentially a two-step process:

    1) Find the <uniqueish row identifier>, MAX(VersionNum) GROUP BY <uniqueish row identifier>

    2) JOIN back to the main table.

    I certainly...

  • RE: Getting Current Stock Report

    Possibly what you are looking for is something like this:

    DECLARE @Inventory TABLE

    (

    InventoryId bigint IDENTITY

    ,TransactionDate datetime

    ,InwardId int

    ...

  • RE: Subqueries

    Any time I see something like "Coding required as Subquery NOT as Join" it tells me for sure this is homework.

    You'll find that few on this forum are willing to...

  • RE: Full Outer Join

    I am not sure if this is what you're trying to do or not but I don't think you need a FULL JOIN for this:

    CREATE TABLE #D(

    [ProdDate] [smalldatetime] NULL,

    [Productions] [varchar](20)...

  • RE: Return the last version of set of records

    kwoznica (11/9/2013)


    Dwain and Piet,

    both of your suggestions work very well. thanks for the reply. I can't believe I missed your suggestion Piet. I was playing with a similar query...

  • RE: Min/Max values using order by

    With 146 points it would seem you've been around long enough to know we need some help from you to help you, namely in the form of DDL and sample...

  • RE: string splitting with charindex

    Phil Parkin (11/7/2013)


    Also, I might suggest changing the name of your column.

    :w00t:

    Reminds me of a report one of my ex co-workers used to run every month.

    It was a pay...

  • RE: results incorrect ROW_NUMBER() OVER (PARTITION BY

    mickyT (11/7/2013)


    Thanks ... inspired by others (Jeff) of course:-)

    Of course. I'd say mine too, but in this particular case since they both work, I'd go with Micky's (advice to...

  • RE: results incorrect ROW_NUMBER() OVER (PARTITION BY

    mickyT (11/7/2013)


    Just realized that I was reading the dates the wrong way.

    Will edit my previous to fix

    Other than the dates being wrong in your sample table, it still works because...

Viewing 15 posts - 1,141 through 1,155 (of 3,957 total)