Shipment Group (tbl)

From UG

(Difference between revisions)
Jump to: navigation, search
 
(3 intermediate revisions not shown)
Line 1: Line 1:
-
[[Category:DB]]
+
[[Category:Shipment Data Objects]]
Line 16: Line 16:
== Useful Queries ==
== Useful Queries ==
 +
 +
* selectAll
   SELECT sg.Id AS Id, sg.MasterId as MasterId, tm.Id AS TransportModeId, tm.Mode AS TransportModeValue,  
   SELECT sg.Id AS Id, sg.MasterId as MasterId, tm.Id AS TransportModeId, tm.Mode AS TransportModeValue,  
Line 22: Line 24:
             WHERE sg.TransportModeId=tm.Id AND sg.ClientCompanyId=cc.Id  
             WHERE sg.TransportModeId=tm.Id AND sg.ClientCompanyId=cc.Id  
             ORDER BY Id;
             ORDER BY Id;
 +
 +
* delete grp
 +
 +
DELETE FROM tblShipmentGroup WHERE Id= ...
 +
 +
*
 +
 +
SELECT Id AS Id FROM tblGenericShipment WHERE ShipmentGroupId = ... ORDER BY Id

Current revision as of 08:46, 31 January 2010


mysql> describe tblShipmentGroup;
+-----------------+---------+------+-----+---------+----------------+
| Field           | Type    | Null | Key | Default | Extra          |
+-----------------+---------+------+-----+---------+----------------+
| Id              | int(10) | NO   | PRI | NULL    | auto_increment |
| TransportModeId | int(10) | NO   | MUL | NULL    |                |
| ClientCompanyId | int(10) | NO   | MUL | NULL    |                |
| MasterId        | int(10) | YES  | MUL | NULL    |                |
+-----------------+---------+------+-----+---------+----------------+
4 rows in set

[edit] Useful Queries

  • selectAll
  SELECT sg.Id AS Id, sg.MasterId as MasterId, tm.Id AS TransportModeId, tm.Mode AS TransportModeValue, 
           cc.Id AS ClientCompanyId, cc.CompanyName AS ClientCompanyName 
           FROM tblShipmentGroup sg, tblTransportMode tm, tblClientCompany cc 
           WHERE sg.TransportModeId=tm.Id AND sg.ClientCompanyId=cc.Id 
           ORDER BY Id;
  • delete grp
DELETE FROM tblShipmentGroup WHERE Id= ...
SELECT Id AS Id FROM tblGenericShipment WHERE ShipmentGroupId = ... ORDER BY Id
Personal tools