Viewing 6 posts - 1 through 7 (of 7 total)
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...
April 1, 2013 at 8:20 am
You are correct. Mark's orginal query worked perfect. I must of copied it wrong.
Again Thank you for your help.
Todd
January 22, 2010 at 2:26 pm
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...
January 22, 2010 at 2:21 pm
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 ...
January 22, 2010 at 1:56 pm
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',...
January 22, 2010 at 1:36 pm
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...
January 22, 2010 at 1:23 pm
Viewing 6 posts - 1 through 7 (of 7 total)