Skip to content

Instantly share code, notes, and snippets.

@tomlea
Created November 28, 2008 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomlea/29986 to your computer and use it in GitHub Desktop.
Save tomlea/29986 to your computer and use it in GitHub Desktop.
select @session := COALESCE(max(session), 0) + 1 from product_invalidations;
insert product_invalidations(product_id, session) select p.id, @session from products p inner join product_types pt on pt.id = p.product_type_id where pt.name = 'mobile-phones';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment