Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql check if a record exists

-- Method 1.
SELECT 1
FROM table_name
WHERE unique_key = value;

-- Method 2.
SELECT COUNT(1)
FROM table_name
WHERE unique_key = value;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sql #check #record #exists
ADD COMMENT
Topic
Name
9+4 =