1:create view bbps_vwPreAdjustmentSplits as
   2:select
   3:        adjustmentSequence,
   4:        
   5:        giftLinkId,
   6:        
   7:        giftsplitid,
   8:        giftid,
   9:        originalGiftId,
  10:        adjustmentid,
  11:        amount,
  12:        fundid,
  13:        campaignid,
  14:        appealid,
  15:        packageid,
  16:        sequence,
  17:        import_id 
  18:
  19:from
  20:        (
  21:        select 
  22:                adjustmentSequence,
  23:                giftLinkId,
  24:                giftsplitid,
  25:                giftid,
  26:                originalGiftId,
  27:                adjustmentid,
  28:                amount,
  29:                fundid,
  30:                campaignid,
  31:                appealid,
  32:                packageid,
  33:                sequence,
  34:                import_id       
  35:        from 
  36:                bbps_vwFirstAdjustmentSplits
  37:                
  38:        union
  39:        select 
  40:                adjustmentSequence,
  41:                giftLinkId,
  42:                giftsplitid,
  43:                giftid,
  44:                originalGiftId,
  45:                adjustmentid,
  46:                amount,
  47:                fundid,
  48:                campaignid,
  49:                appealid,
  50:                packageid,
  51:                sequence,
  52:                import_id 
  53:        from 
  54:                bbps_vwFinalAdjustmentSplits
  55:        ) as smack
  56:
  57:--order by originalGiftId desc, adjustmentSequence
  58: