Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO alarms (status, type)
- SELECT * FROM (SELECT '2', '1') AS tmp
- WHERE NOT EXISTS
- ( SELECT type FROM alarms WHERE (type = '1')) LIMIT 1;
- INSERT INTO alarms (status, type)
- SELECT * FROM (SELECT '2', '1') AS tmp
- WHERE NOT EXISTS
- ( SELECT type, status FROM alarms WHERE (type = '1' AND status = '5')) LIMIT 1;
- If Not Exists( SELECT type, status FROM alarms WHERE (type = '1' AND status = '5'))
- Begin
- INSERT INTO alarms (status, type) values ("Y","type")
- End
Add Comment
Please, Sign In to add comment