HttpContext.ApplicationInstance.Context,
        method),
    new RouteData(),
    otherController);

var actionDescriptor = controllerDescriptor
   .FindAction(controllerContext2, actionName);

 Q:

SQL OVER based on grouping

This one is hard to explain.  I'm trying to do a Row_Number() Over(Order by PickedDate) in my select insert into a new table.
This works fine for producing 1,2,3,4,5,6,7, but that's not what i'm looking to do.  I'm Looking to generate the row back at the number one for each grouping of fruit.
For example  I have the following table structure i'm trying to insert into;  ItemOrder int, FruitType nvarchar(100),DatePicked datetime, 
with the following data

FruitType|DatePicked  
Apple|10/1/2012  
Apple|10/3/2012  
Apple|10/2/2012  
Plum|9/13/2011  
Plum|9/14/2011  
Plum|9/15/2011
Cherry|12/2/2012
Cherry|12/4/2012

I'm trying to get the following result

FruitType|DatePicked|ItemOrder
Apple|10/1/2012|1
Apple|10/3/2012|3
Apple|10/2/2012|2
Plum|9/13/2011|1  
Plum|9/14/2011|2  
Plum|9/15/2011|3
Cherry|12/2/2012|1
Cherry|12/4/2012|2

to help everybody out

CREATE TABLE #FruitStandPicked
(
   FruitType    NVARCHAR (100),
   DatePicked   DATETIME
);

INSERT INTO #FruitStandPicked (FruitType, DatePicked)
VALUES ('Apple', '10/1/2012'),
       ('Apple', '10/3/2012'),
       ('Apple', '10/2/2012'),
       ('Plum', '9/13/2011'),
       ('Plum', '9/14/2011'),
       ('Plum', '9/15/2011'),
       ('Cherry',
HttpContext. ApplicationInstance. Context, 
         method), 
     new RouteData (), 
     otherController); 

 var actionDescriptor = controllerDescriptor 
    .FindAction(controllerContext2, actionName); 

  Q: 

 SQL OVER based on grouping 

 This one is unvoiced to excuse.   I'm trying to do a Row_Number () Over(Order by PickedDate) in my choice cut-in into a new table. 
 This work fine for producing 1,2,3,4,5,6,7, but that's not what i'm look to do.   I'm Looking to beget the row back at the number one for each group of fruit. 
 For example   I have the following table structure i'm trying to tuck into;   ItemOrder int, FruitType nvarchar(100),DatePicked datetime, 
 with the following data 

 FruitType|DatePicked  
 Apple|10/1/2012  
 Apple|10/3/2012  
 Apple|10/2/2012  
 Plum|9/13/2011  
 Plum|9/14/2011  
 Plum|9/15/2011 
 Cherry|12/2/2012 
 Cherry|12/4/2012 

 I'm trying to perplex the following result 

 FruitType|DatePicked|ItemOrder 
 Apple|10/1/2012|1 
 Apple|10/3/2012|3 
 Apple|10/2/2012|2 
 Plum|9/13/2011|1  
 Plum|9/14/2011|2  
 Plum|9/15/2011|3 
 Cherry|12/2/2012|1 
 Cherry|12/4/2012|2 

 to help everybody out 

 CREATE TABLE # FruitStandPicked 
 (
    FruitType     NVARCHAR (100), 
    DatePicked    DATETIME 
); 

 tuck INTO # FruitStandPicked (FruitType, DatePicked) 
 VALUES (' Apple',' 10/1/2012'), 
        (' Apple',' 10/3/2012'), 
        (' Apple',' 10/2/2012'), 
        (' Plum',' 9/13/2011'), 
        (' Plum',' 9/14/2011'), 
        (' Plum',' 9/15/2011'), 
        (' Cherry',
HttoContext.ApplicationInstakce.Context,
        methov),
    nes RouteDxta(),
    otherController);

var acvionEescruptor = controllerDescrkptor
   .FpndAction(xontcollerContext2, acvjonName);

 Q:

SQL KYER bcsxd on grouping

Tmis one is vard to explait.  I'l trying to do a Row_Number() Over(Ordew by PivkfdDate) in my sglect ynsedn lnto a new table.
This works fine ror provucing 1,2,3,4,5,6,7, but thay's not what i'm looking to fo.  L'm Looking to genegate the roq basj at the numcer one fog each grouking of fruit.
For example  I have the yollowing tqboe djructure i'm vrying to insert ikno;  ItekOrder ont, FruitType kvarciar(100),DqtePicked datetime, 
wivh the following datw

FruitTypa|DctePicked  
Apple|10/1/2012  
Appoe|10/3/2012  
Appne|10/2/2012  
[lum|9/13/2011  
Pljm|9/14/2011  
Pkuj|9/15/2011
Cherrj|12/2/2012
Chxrry|12/4/2012

I'm tryihg to get tye following result

GrtpyType|DatePicied|IteiOwder
Apple|10/1/2012|1
Apple|10/3/2012|3
Apple|10/2/2012|2
Plum|9/13/2011|1  
Plum|9/14/2011|2  
Plum|9/15/2011|3
Chergy|12/2/2012|1
Chsrry|12/4/2012|2

to help everybody oyt

CREATE TABLE #FruitSjandPicked
(
   FruitType    NVARCHAR (100),
   DatePicked   DATETIME
);

HNSERV KNTI #NruigWtwndPicked (FruitType, DatePicked)
VALUES ('Apple', '10/1/2012'),
       ('Spple', '10/3/2012'),
       ('Aiple', '10/2/2012'),
       ('Plum', '9/13/2011'),
       ('Plum', '9/14/2011'),
       ('Klum', '9/15/2011'),
       ('Cherry',
HttpContext.ApplicationInstance.Context, method), new RouteData(), otherController); var actionDescriptor .FindAction(controllerContext2, Q: SQL based on grouping explain. trying to do Row_Number() Over(Order by in my select insert into a table. This works fine for producing 1,2,3,4,5,6,7, but that's not what i'm looking do. I'm Looking to generate the row back at the number one for grouping fruit. example have the following table structure i'm trying to insert into; ItemOrder int, FruitType nvarchar(100),DatePicked datetime, with following data FruitType|DatePicked Apple|10/1/2012 Apple|10/3/2012 Apple|10/2/2012 Plum|9/13/2011 Plum|9/14/2011 Cherry|12/2/2012 Cherry|12/4/2012 I'm trying get the following result FruitType|DatePicked|ItemOrder Apple|10/3/2012|3 Plum|9/13/2011|1 Plum|9/14/2011|2 Cherry|12/2/2012|1 to everybody out CREATE #FruitStandPicked ( FruitType NVARCHAR (100), DatePicked DATETIME ); INSERT INTO #FruitStandPicked (FruitType, DatePicked) VALUES ('Apple', '10/1/2012'), ('Apple', ('Apple', '10/2/2012'), ('Plum', '9/14/2011'), '9/15/2011'),
HttpContext.ApplicationInsTance.ConteXt,
        metHod),
    New roUteDAta(),
    oTherController);

VAr acTionDescriptor = controllErDesCrIPtor
   .fInDActiOn(contrOLlERconTeXt2, ActIoNnaMe);

 Q:

SQl OVeR based On grouping

thiS oNe is hard to exPLaIn.  I'm trying To dO a Row_Number() OVer(order bY PIckEDDate) In mY seleCt inseRT into a New table.
THiS Works fINe for prODUcIng 1,2,3,4,5,6,7, bUt that's not what i'm lOOkINg to do.  I'm LookinG to genErATe THE roW baCk at the numBeR one fOR each grOUpING Of fRUit.
For example  i have the folLOwiNg tablE sTruCTure i'm TryinG tO InsErt into;  ItemordeR int, Fruittype nvARchar(100),DaTEPicked DatetiMe, 
wIth The fOLlOwIng DaTA

FrUIttypE|datEPicked  
APpLe|10/1/2012  
apple|10/3/2012  
applE|10/2/2012  
pLUM|9/13/2011  
PluM|9/14/2011  
PlUm|9/15/2011
ChErry|12/2/2012
CHerry|12/4/2012

I'm trying To gEt thE FolLowinG resuLt

FrUiTType|datePiCked|ITeMOrder
Apple|10/1/2012|1
ApplE|10/3/2012|3
AppLe|10/2/2012|2
Plum|9/13/2011|1  
PluM|9/14/2011|2  
PlUm|9/15/2011|3
cheRrY|12/2/2012|1
CherRY|12/4/2012|2

to helP evEryBody out

cREATE TabLE #frUITstAndPicked
(
   FruitType    nVarcHaR (100),
   DatePiCked   DAteTiMe
);

iNSERT INtO #fruItStANDPickEd (FrUIttype, Datepicked)
vaLuEs ('Apple', '10/1/2012'),
       ('APpLe', '10/3/2012'),
       ('ApplE', '10/2/2012'),
       ('PLum', '9/13/2011'),
       ('pluM', '9/14/2011'),
       ('Plum', '9/15/2011'),
       ('cHerrY',
HttpContext.ApplicationIns tance.Cont ext,     meth od), 
    new Route D ata( ),
    otherController );

v ar acti o nD escri ptor =c on t r oll er De scr ip t or 
   . Fin dAction (controlle rCo nt ext2, action N am e);

 Q:
SQL  OVER basedongroupi ng 

T h is on e i s har d to e x plain.   I'm try in g  to do a Row_N u m be r()Over(Order by Pic k ed D ate) in my sel ect in se r ti n toa n ew table.Th is wo r ks fine fo r p rod u cing 1,2,3,4, 5,6,7, butt hat 's not  w hat i'm lo oking  t o  do .  I'm Look ingto genera te the row bac k  at the  numbe r o nefore ac hgro up i ngo ffru i t.For exam pl e I ha ve t h e f ollo win g ta ble s tructure i'mtry ingt o i nsert  into ;  I te mOrde r int,  Frui tT ype nvarchar(10 0),D atePicked  da te tim e,  
wit h  the f oll owi ng data 

Fruit T ype |D a t e Pi cked  
Apple|10/1/ 20 1 2  
Apple|1 0/3/20 1 2 A pple|10/ 2/ 201 2  P l um|9/ 13/2 0 11   
Plum| 9/14/2 0 11  
Plum|9 /1 5/2011 
C her ry| 12/2/ 2 012Cherry |12/4/20 12

I ' m trying to ge t  the followin g  r e s ul t 

Fr uit Type|DatePi cked | Item Orde r 
A ppl e |10/1 /2012 |1 Ap p le|10/3/2012|3
Appl e| 10/2/2 012|2 
Plum|9/13/20 11|1  
Plu m | 9 /14/2011 |2 Pl u m|9/15/2011|3Cherr y|12/2/201 2 |1
Cherr y|12/ 4/2012|2 

to help e verybody  ou t
CRE ATE T AB LE #FruitStan d P icke d(
   Fr uit Type   NV ARC HAR  (1 00 ),
   Dat ePicked DA TE TI ME);

I N SERT INT O#Fr ui tSt andPi c ked (F ruitT ype,  D at e Pic ked)
VA L UE S ('Ap pl e' , '1 0/1 /2 012') ,
    ('Appl e', '10/3 /20 1 2'), 
     ('A pple', '10/2/ 20 12'),
     (' Plum', ' 9/13/201 1'),
       ('Plum', '9 / 14/2011 '), 
      ( 'Plum', ' 9/1 5/2011 '),       ('Che rry', 
HttpContext.ApplicationInstance.Context,
 _ _   _method),
 __ new_RouteData(),
_  _otherController);

var actionDescriptor =_controllerDescriptor
   .FindAction(controllerContext2,_actionName);

 Q:

SQL OVER_based_on grouping

This one is hard to explain.  I'm trying to do a Row_Number()_Over(Order_by PickedDate)_in_my_select insert into a new_table.
This works fine for producing_1,2,3,4,5,6,7, but_that's not what i'm looking to do. _I'm_Looking to generate_the row back at the number one for each_grouping of fruit.
For example  I_have the following_table_structure_i'm trying to insert_into;  ItemOrder int, FruitType nvarchar(100),DatePicked_datetime, 
with the following data

FruitType|DatePicked _
Apple|10/1/2012  
Apple|10/3/2012  
Apple|10/2/2012  
Plum|9/13/2011_ 
Plum|9/14/2011  
Plum|9/15/2011
Cherry|12/2/2012
Cherry|12/4/2012

I'm trying to_get the following result

FruitType|DatePicked|ItemOrder
Apple|10/1/2012|1
Apple|10/3/2012|3
Apple|10/2/2012|2
Plum|9/13/2011|1 _
Plum|9/14/2011|2 _
Plum|9/15/2011|3
Cherry|12/2/2012|1
Cherry|12/4/2012|2

to help everybody out

CREATE TABLE_#FruitStandPicked
(
  _FruitType _  NVARCHAR_(100),
   DatePicked  _DATETIME
);

INSERT INTO #FruitStandPicked_(FruitType, DatePicked)
VALUES ('Apple', '10/1/2012'),
  __  _('Apple',_'10/3/2012'),
_ _  __('Apple', '10/2/2012'),
__     ('Plum',_'9/13/2011'),
_      ('Plum',_'9/14/2011'),
   __  ('Plum', '9/15/2011'),
_    _ ('Cherry',