# `viw_zsgd_lld_materialanalysis` (view)


- **Updatable:** NO

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 1 | `sId` | `varchar(100)` | NO |
| 2 | `sBillNo` | `varchar(255)` | NO |
| 3 | `tCreateDate` | `datetime` | NO |
| 4 | `sCustomerName` | `varchar(255)` | YES |
| 5 | `sProductName` | `varchar(100)` | YES |
| 6 | `sMaterialsId` | `varchar(100)` | NO |
| 7 | `lldsMaterialsId` | `varchar(100)` | YES |
| 8 | `sMaterialsStyle` | `varchar(255)` | NO |
| 9 | `lldsMaterialsName` | `varchar(100)` | YES |
| 10 | `sMaterialsName` | `varchar(100)` | YES |
| 11 | `iOrder` | `int` | YES |
| 12 | `dAuxiliaryQty` | `decimal(18,6)` | NO |
| 13 | `LldQty` | `decimal(40,6)` | YES |
| 14 | `LldsMaterialsStyle` | `varchar(255)` | YES |
| 15 | `dProductQty` | `decimal(18,6)` | NO |
| 16 | `dDifQty` | `decimal(41,6)` | YES |
| 17 | `sProductId` | `varchar(100)` | NO |
| 18 | `sCustomerId` | `varchar(100)` | NO |
| 19 | `sBrandsId` | `varchar(100)` | NO |
| 20 | `sSubsidiaryId` | `varchar(100)` | NO |
| 21 | `sSlaveId` | `varchar(100)` | NO |
| 22 | `dMaterialsMoney` | `decimal(18,6)` | NO |
| 23 | `dMaterialsPrice` | `decimal(18,6)` | NO |
| 24 | `bSlaveBillComplete` | `bit(1)` | YES |
| 25 | `bBillComplete` | `bit(1)` | NO |
| 26 | `tBillCompleteDate` | `datetime` | YES |
| 27 | `sLossMemo` | `text` | YES |
| 28 | `iChangeType` | `int` | NO |
| 29 | `bInvalid` | `bit(1)` | NO |
| 30 | `bCheck` | `bit(1)` | NO |

## Definition

```sql
select `sgd`.`sId` AS `sId`,`sgd`.`sBillNo` AS `sBillNo`,`sgd`.`tCreateDate` AS `tCreateDate`,`e`.`sCustomerName` AS `sCustomerName`,`ep`.`sProductName` AS `sProductName`,`sgd`.`sMaterialsId` AS `sMaterialsId`,`lld`.`lldsMaterialsId` AS `lldsMaterialsId`,`sgd`.`sMaterialsStyle` AS `sMaterialsStyle`,`em1`.`sMaterialsName` AS `lldsMaterialsName`,`em`.`sMaterialsName` AS `sMaterialsName`,`em`.`iOrder` AS `iOrder`,`sgd`.`dAuxiliaryQty` AS `dAuxiliaryQty`,`lld`.`LldQty` AS `LldQty`,`lld`.`LldsMaterialsStyle` AS `LldsMaterialsStyle`,`sgd`.`dProductQty` AS `dProductQty`,(`lld`.`LldQty` - `sgd`.`dAuxiliaryQty`) AS `dDifQty`,`sgd`.`sProductId` AS `sProductId`,`sgd`.`sCustomerId` AS `sCustomerId`,`sgd`.`sBrandsId` AS `sBrandsId`,`sgd`.`sSubsidiaryId` AS `sSubsidiaryId`,`sgd`.`sSlaveId` AS `sSlaveId`,`sgd`.`dMaterialsMoney` AS `dMaterialsMoney`,`sgd`.`dMaterialsPrice` AS `dMaterialsPrice`,`sgd`.`bSlaveBillComplete` AS `bSlaveBillComplete`,`sgd`.`bBillComplete` AS `bBillComplete`,`sgd`.`tBillCompleteDate` AS `tBillCompleteDate`,`sgd`.`sLossMemo` AS `sLossMemo`,`sgd`.`iChangeType` AS `iChangeType`,`sgd`.`bInvalid` AS `bInvalid`,`sgd`.`bCheck` AS `bCheck` from (((((`viw_mftworkordermaterials` `sgd` left join `viw_zlldgroupby_sgdandsmaterialsid` `lld` on((`sgd`.`sSlaveId` = `lld`.`sWorkOrderMaterialsTbId`))) left join `elecustomer` `e` on((`sgd`.`sCustomerId` = `e`.`sId`))) left join `eleproduct` `ep` on((`sgd`.`sProductId` = `ep`.`sId`))) left join `elematerials` `em` on((`sgd`.`sMaterialsId` = `em`.`sId`))) left join `elematerials` `em1` on((`lld`.`lldsMaterialsId` = `em1`.`sId`)))
```

## Narrative

_No human-written narrative yet._
