# `viw_outsidecostmoney_ymw` (view)


- **Updatable:** NO

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 1 | `sId` | `varchar(100)` | NO |
| 2 | `sSlaveId` | `varchar(100)` | NO |
| 3 | `sSubsidiaryId` | `varchar(100)` | NO |
| 4 | `sBrandsId` | `varchar(100)` | NO |
| 5 | `sFormId` | `varchar(100)` | NO |
| 6 | `sCostPeriod` | `varchar(100)` | NO |
| 7 | `sSalesOrderNo` | `varchar(100)` | NO |
| 8 | `sWorkOrderNo` | `varchar(100)` | NO |
| 9 | `sProductId` | `varchar(100)` | NO |
| 10 | `sProductName` | `varchar(100)` | NO |
| 11 | `sProductNo` | `varchar(100)` | NO |
| 12 | `sProcessName` | `varchar(100)` | NO |
| 13 | `sBillNo` | `varchar(255)` | NO |
| 14 | `sOutsideType` | `varchar(255)` | NO |
| 15 | `dOutSideCostMoney1` | `decimal(40,6)` | YES |
| 16 | `dOutSideCostMoney2` | `decimal(40,6)` | YES |
| 17 | `dOutSideCostMoney3` | `decimal(40,6)` | YES |
| 18 | `dOutSideCostMoney4` | `decimal(40,6)` | YES |
| 19 | `dOutSideCostMoney5` | `decimal(40,6)` | YES |
| 20 | `dOutSideCostMoney6` | `decimal(40,6)` | YES |
| 21 | `dOutSideCostMoney8` | `decimal(40,6)` | YES |
| 22 | `dOutSideCostMoney7` | `decimal(40,6)` | YES |

## Definition

```sql
select `accordercostanalysis`.`sId` AS `sId`,`accordercostanalysis`.`sId` AS `sSlaveId`,`accordercostanalysis`.`sSubsidiaryId` AS `sSubsidiaryId`,`accordercostanalysis`.`sBrandsId` AS `sBrandsId`,`accordercostanalysis`.`sFormId` AS `sFormId`,`accordercostanalysis`.`sCostPeriod` AS `sCostPeriod`,`accordercostanalysis`.`sSalesOrderNo` AS `sSalesOrderNo`,`accordercostanalysis`.`sWorkOrderNo` AS `sWorkOrderNo`,`accordercostanalysis`.`sProductId` AS `sProductId`,`accordercostanalysis`.`sProductName` AS `sProductName`,`accordercostanalysis`.`sProductNo` AS `sProductNo`,`accordercostanalysis`.`sProcessName` AS `sProcessName`,`accordercostanalysis`.`sBillNo` AS `sBillNo`,`accordercostanalysis`.`sOutsideType` AS `sOutsideType`,sum((case when ((`accordercostanalysis`.`iType` = 5) and (`accordercostanalysis`.`sOutsideType` = 'outside')) then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney1`,sum((case when ((`accordercostanalysis`.`iType` = 3) and (`accordercostanalysis`.`sOutsideType` = 'outside')) then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney2`,sum((case when ((`accordercostanalysis`.`iType` = 7) and (`accordercostanalysis`.`sOutsideType` = 'outside')) then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney3`,sum((case when ((`accordercostanalysis`.`iType` = 5) and (`accordercostanalysis`.`sOutsideType` = 'productOutside')) then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney4`,sum((case when ((`accordercostanalysis`.`iType` = 3) and (`accordercostanalysis`.`sOutsideType` = 'productOutside')) then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney5`,sum((case when ((`accordercostanalysis`.`iType` = 7) and (`accordercostanalysis`.`sOutsideType` = 'productOutside')) then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney6`,sum((case when (`accordercostanalysis`.`sOutsideType` = 'productOutside') then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney8`,sum((case when (`accordercostanalysis`.`sOutsideType` = 'outside') then ifnull(`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney7` from `accordercostanalysis` where (`accordercostanalysis`.`iType` in (3,5,7)) group by `accordercostanalysis`.`sCostPeriod`,`accordercostanalysis`.`sSalesOrderNo`,`accordercostanalysis`.`sWorkOrderNo`,`accordercostanalysis`.`sProductId`
```

## Narrative

_No human-written narrative yet._
