-
-
Save lynnkwong/3e2c7c48d3152897fbca6d91885c3aea to your computer and use it in GitHub Desktop.
This file contains 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 some new records. | |
INSERT INTO data.product_stocks | |
(category, stock, check_time) | |
VALUES | |
('Laptops', 1313, '2022-01-02 18:00:00'), | |
('Tablets', 867, '2022-01-02 18:00:00'), | |
('Cellphones', 5000, '2022-01-02 18:00:00') | |
ON DUPLICATE KEY UPDATE | |
stock = VALUES(stock) | |
; | |
-- Check records with stock greater than 0. | |
SELECT * FROM data.product_stocks | |
WHERE stock > 0 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment