Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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

sql where clause

SELECT column1, column2, ...                                                
FROM table_name
WHERE condition
Comment

WHERE keyword SQL

-- The WHERE keyword allows you to filter based on both text and numeric values in a table. 

-- There are a few different comparison operators you can use:
-- = equal
-- <> not equal
-- < less than
-- > greater than
-- <= less than or equal to
-- >= greater than or equal to

SELECT example_column
FROM example_table
WHERE example_column = 'example_value';
Comment

PREVIOUS NEXT
Code Example
Sql :: illuminate database queryexception could not find driver (sql select * from 
Sql :: insert into table using openquery 
Sql :: sql update by id 
Sql :: postgresql like 
Sql :: mysql join column order By and group By 
Sql :: sql join on wildcard 
Sql :: mysql dump structure only 
Sql :: sql server inner join 
Sql :: List MySQL Table and Index Size 
Sql :: sql create database statement 
Sql :: select all columns except one sql 
Sql :: install pymysql in python 3 in windows 7 v2.7.10 codes with pip 
Sql :: Order of execution SQL or MySql query Or Logical order of operations: 
Sql :: show broken table mysql 
Sql :: how to install mssql on mac 
Sql :: sql commands 
Sql :: sql server get number of working days in a month 
Sql :: join three tables sql 
Sql :: mysql large import 
Sql :: mysql delete if not in another table 
Sql :: mysql trigger to delete old data 
Sql :: ignore duplicate rows in sqlite 
Sql :: mysql workbench primary key 
Sql :: what is common table expression in sql 
Sql :: timestamp type in sql 
Sql :: sql and or 
Sql :: jsonb 
Sql :: set identity_insert off 
Sql :: app times 
Sql :: SQL - Row Number into Alphabetical characters 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =