SQL IN Operator

The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax SELECT column_name(s) FROM table_name WHERE column_name IN (value1,value2,…); Example SELECT * FROM Customers WHERE City IN (‘Paris’,’London’);

Read More

Posted in SQL Tagged Comments Off on SQL IN Operator
SQL Wildcards

A wildcard character can be used to substitute for any other character(s) in a string. SQL Wildcard Characters In SQL, wildcard characters are used with the SQL LIKE operator. SQL wildcards are used to search for data within a table. With SQL, the wildcards are: Wildcard Description % A substitute for zero or more characters _ A substitute for a single character Matches only a character NOT specified…

Read More

Posted in SQL Tagged Comments Off on SQL Wildcards
SQL LIKE Operator

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. The SQL LIKE Operator The LIKE operator is used to search for a specified pattern in a column. SQL LIKE Syntax SELECT column_name(s) FROM table_name WHERE column_name LIKE pattern; SQL LIKE Operator Examples The following SQL statement selects all customers with a City starting with the letter “s”: Example SELECT * FROM Customers WHERE City LIKE ‘s%’; or SELECT * FROM Customers WHERE Country LIKE ‘%land%’;

Read More

Posted in SQL Comments Off on SQL LIKE Operator
SQL SELECT TOP Clause

The SQL SELECT TOP Clause The SELECT TOP clause is used to specify the number of records to return. The SELECT TOP clause can be very useful on large tables with thousands of records. Returning a large number of records can impact on performance. Note: Not all database systems support the SELECT TOP clause. SQL Server / MS Access Syntax SELECT TOP number|percent column_name(s) FROM table_name;   SQL SELECT TOP Equivalent in MySQL and Oracle MySQL Syntax SELECT column_name(s) FROM table_name LIMIT number; Example SELECT *…

Read More