1:drop view bbps_vwFinalAdjustmentSplits;
   2:create view bbps_vwFinalAdjustmentSplits as
   3:select 
   4:        sequenceNums.adjustmentSequence,
   5:        
   6:        gs.adjustmentId as giftLinkId,
   7:        
   8:        gs.giftsplitid,
   9:        gs.giftid,
  10:        sequenceNums.giftId as originalGiftId,
  11:        gs.adjustmentid,
  12:        gs.amount,
  13:        gs.fundid,
  14:        gs.campaignid,
  15:        gs.appealid,
  16:        gs.packageid,
  17:        gs.sequence,
  18:        gs.import_id
  19:
  20:
  21:from
  22:        (
  23:        select 
  24:                sequence as adjustmentSequence,
  25:                adjustmentId,
  26:                giftId
  27:        from
  28:                giftAdjustment
  29:
  30:        ) as sequenceNums
  31:
  32:        inner join
  33:        gift g
  34:                on g.id = sequenceNums.adjustmentId
  35:        
  36:        inner join
  37:        giftsplit gs
  38:                on gs.adjustmentId = g.id