Created
September 20, 2016 22:51
-
-
Save a1994sc/798d88f4e69fe1403d4ef04aa0b8cb8f to your computer and use it in GitHub Desktop.
A insert or replace to add a number to sql entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert or replace into office | |
values | |
(124567, | |
(select | |
case | |
when (select exists(select 1 from office where sku = 124567)) | |
then (select count from office where sku = 124567) | |
when 1 then 0 | |
end | |
) + 1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment