On 01/06/2012 15:19, John English wrote:
I'm having trouble with the following error: "Conglomerate could not be
created". It happens when I do this:

  INSERT INTO resource_usage (resid,itemid,itemtype)
    (SELECT resid,?,? FROM resource_usage
     WHERE itemid=?
     AND   itemtype=?
     AND   NOT EXISTS (SELECT resid FROM resource_usage
                       WHERE itemid=? AND itemtype=?));

I also get the same error from this, which looks fairly innocuous to me:
INSERT INTO resource_usage (resid,itemid,itemtype)
   (SELECT resid,20,'final' FROM resource_usage WHERE itemid=? AND itemtype=?);
Is it perhaps because I'm inserting into the same table I'm selecting from?
John English If we were to define a religion to be a system of thought which contains unprovable statements, so it contains an element of faith, then Gödel has taught us that not only is mathematics a religion but it is the only religion able to prove itself to be one.
John Barrow, Pi in the Sky