Forum Replies Created

Viewing 6 posts - 1 through 7 (of 7 total)

  • RE: Looking for a query to return rows in tableA that are inclusive of ID in tableB

    TableB contains the combination that all must be met in tableA order to be returned from tableA. For instance

    Desired Output

    A_ID A_text

    1, Yes1

    2, Yes1

    99, Yes1

    The A_id 1, 2 and...

  • RE: Stuck on T-sql with ordering of result set

    You are correct. Mark's orginal query worked perfect. I must of copied it wrong.

    Again Thank you for your help.

    Todd

  • RE: Stuck on T-sql with ordering of result set

    Thanks both of you for your help. You led me in the right direction.

    This query returns the result order that I needed:

    SELECT * ,max(QNTY) OVER(PARTITION BY PartGroup ) as...

  • RE: Stuck on T-sql with ordering of result set

    Almost... That query returns:

    OrderDatePartGroupSubCodeQNTY

    2010-01-10 00:00:00.000ZZZZZZ.DB11200

    2010-01-10 00:00:00.000ZZZZZZ.DB10100

    2010-01-10 00:00:00.000ABCABC.DB12400

    2010-01-10 00:00:00.000ABCABC.DB12400

    2010-01-10 00:00:00.000ABCABC.DB10343

    2010-01-10 00:00:00.000ABCABC.DB11234

    2010-01-10 00:00:00.000ABCABC.DB101

    2010-01-10 00:00:00.000YYYYYY.DB12450

    2010-01-10 00:00:00.000BBBBBB.DB12 533

    2010-01-10 00:00:00.000BBBBBB.DB11 ...

  • RE: Stuck on T-sql with ordering of result set

    CREATE TABLE [dbo].[TestTable](

    [OrderDate] [datetime] NOT NULL,

    [PartGroup] [varchar](6) NOT NULL,

    [SubCode] [varchar](25) NOT NULL,

    [QNTY] [int] NOT NULL

    ) ON [PRIMARY]

    INSERT INTO [dbo].[TestTable] Values ('1-10-2010', 'ABC', 'ABC.DB12', 400)

    INSERT INTO [dbo].[TestTable] Values ('1-10-2010', 'ABC', 'ABC.DB10',...

  • RE: Stuck on T-sql with ordering of result set

    Thanks for your reply but that query gives me the partgroup in alpha order. I need the results by group byt partgroup with by qnty.

    results should be:

    Date PartGroup subcode...

Viewing 6 posts - 1 through 7 (of 7 total)