Read: MariaDB Not Between MariaDB Add Column If Not Exists The statement will INSERT the row because there is a ‘ NOT‘ keyword before the EXISTS keyword. FALSE will be produced if the row doesn’t really exist in the table. We are picking the record from table STATES_OF_USA in the outer query with the NOT EXISTS clause. SELECT STATE_NAME FROM STATES_OF_USA WHERE STATE_NAME = 'ARIZONA' SELECT * FROM (SELECT 3 AS STATE_ID, 'ARIZONA' AS STATE_NAME,'AZ' AS STATE_SHORTFORM,'LOW' AS STATE_POPULATION) AS temp Let’s have a look at the illustrated example of the insert if not exist by the following query:ĮXAMPLE: INSERT INTO STATES_OF_USA (STATE_ID,STATE_NAME,STATE_SHORTFORM,STATE_POPULATION)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |