Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql select where in

SELECT * FROM table_name WHERE country IN ('SPAIN', 'MEXICO');
Comment

SQL SELECT WHERE Clause

SELECT *
FROM Customers
WHERE last_name = 'Doe';
Comment

sql select where

SELECT * FROM table_name;
-- Sorting col1 ASCending then col2 DESCending
SELECT col1, col2 FROM table_name ORDER BY col1 ASC, col2 DESC;
-- Filter on col1
SELECT col1, col2 FROM table_name WHERE col1 = 'a value';
-- Containing 'searched'
SELECT col1, col2 FROM table_name WHERE col1 LIKE '%searched%';
-- All different values
SELECT DISTINCT col1 FROM table_name;
-- Simple sum
SELECT col1, sum(col2) FROM table_name GROUP BY col1;
Comment

PREVIOUS NEXT
Code Example
Sql :: how to get date in sql 
Sql :: mysql execute file 
Sql :: sql value exists in column 
Sql :: mysql to uppercase 
Sql :: what is the difference between clustered and non-clustered index in sql server 
Sql :: sql order by multiple columns 
Sql :: select distinct postgres 
Sql :: oracle index size 
Sql :: Create boolean column in MySQL with false as default value? 
Sql :: sql server select last row of each item in group by column 
Sql :: allow null in psql 
Sql :: sql server drop column 
Sql :: importing excel data into sql server 
Sql :: how to find average in sql 
Sql :: oracle dependency 
Sql :: datediff in sql 
Sql :: sample in sql 
Sql :: call postgres function 
Sql :: INITCAP in Oracle example 
Sql :: sql server current time without date 
Sql :: QL HAVING Keyword 
Sql :: select from select sql server 
Sql :: SQL Copy to Another Database 
Sql :: add foreign key to existing table postgres 
Sql :: mongodb vs mysql 
Sql :: stuff sql server 
Sql :: sql server today minus n 
Sql :: mysql count unique in group statement 
Sql :: how to export/import a mysql database via ssh 
Sql :: oracle inner join 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =