Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql select example

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 :: stuff sql server 
Sql :: mysql find_in_set join 
Sql :: timestamp difference sql 
Sql :: oracle group 
Sql :: creating sqeuence in oracle database 
Sql :: if else in mysql stored procedure 
Sql :: sql data types 
Sql :: oracle create tablespace autoextend 
Sql :: sql example query 
Sql :: sql update 
Sql :: run docker container with database as rds metabase 
Sql :: Add new column T-SQL 
Sql :: sqlite commands 
Sql :: mysql datetime format 
Sql :: mysql find db contarint 
Sql :: how to import mysql database command line 
Sql :: sql union operator 
Sql :: create table with float datatype in sql server 
Sql :: how-to-remove-mysql-root-password 
Sql :: sql case statement 
Sql :: sql row having max 
Sql :: BigQuery Remove Duplicate Keys From Table 
Sql :: sqlite modify row 
Sql :: SQL Server run query on linked server 
Sql :: divide by zero error in sql 
Sql :: sql max min 
Sql :: coalesce function in sql server 
Sql :: update join 
Sql :: sql trying to delete database in use 
Sql :: azure sql get all users 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =