INSERT INTO t_inventorystock (id, fk_item, stock_type, creationdate)
VALUES (nextval(‘__t_inventorystock’), ‘3’, ‘ITEM’, ‘2010-04-29’)
SELECT (t_itemtype as t
WHERE t.id = ‘2’ AND t.has_item_stock = 1 AND t.status = 1);
Möchte also aus Tbl1 nur 1 wert überprüfen, ob er true ist.
In diesem Fall bringt er mir ein Fehler bei dem SELECT!
tbl1 kann doch sicher mehrere Records enthalten, und daher sowohl TRUE als auch FALSE in der BOOL-Spalte, oder? Welchen Wert willst Du nun als Bedingung nutzen?
INSERT INTO t_inventorystock (id, fk_item, stock_type, creationdate)
SELECT nextval(‘__t_inventorystock’), ‘28’, ‘ITEM’, ‘2010-04-29’
FROM t_itemtype as t WHERE t.id = ‘2’ AND t.has_item_stock = 1 AND t.status = 1