VbzCart/queries/qryStk History

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | queries
Revision as of 23:04, 3 March 2016 by Woozle (talk | contribs) (dropped)
Jump to navigation Jump to search

About

  • Status: No longer functional; dropped. Legacy data was merged into revised stk_history.
  • Purpose: stk_history plus stk_history_legacy data, if any, with IDs adjusted to prevent duplicates. Lets you see the complete history including legacy stuff, without polluting the main log with non-fixable legacy data.
  • History:
    • 2008-12-29 Created
    • 2008-12-30 Added "ORDER BY ID" so everything will be in sequence (apparently ORDER BY is assumed to refer to the whole UNION, and can't be used within the individual SELECTs that go into the UNION)
    • 2016-03-03 Dropped.

SQL

<mysql>CREATE OR REPLACE VIEW qryStk_History AS SELECT * FROM stk_history UNION SELECT

 CAST(ID-5000 AS SIGNED) AS ID,
 ID_StkBin,
 ID_StkLine,
 CH_OthType,
 ID_OthCont,
 ID_OthLine,
 IDS_OthCont,
 ID_Item,
 QtyBefore,
 QtyAdded,
 QtyAfter,
 QtyBinBefore,
 QtyBinAfter,
 `When`,
 What,
 Notes
 FROM stk_history_legacy

ORDER BY ID;</mysql>