Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgressum when

SUM(CASE WHEN column = value THEN column END) alias

eg

SUM(CASE WHEN car.brand = 'Toyota' THEN sales END) toyota_sales
Comment

PREVIOUS NEXT
Code Example
Sql :: mssql server port 
Sql :: tablas bootstrap responsive sql server para datos vivos 
Sql :: MySQL import data from large CSV file 
Sql :: sql String comparisons case sensitive 
Sql :: calculate date and convert to yearsmysql 
Sql :: select database in mysql 
Sql :: get locked tables sql server 
Sql :: oracle sql number to varchar2 
Sql :: deleting database in sql 
Sql :: sql order by two columns 
Sql :: mysql changer nom table 
Sql :: mysql workbench tutorial 
Sql :: add column alter table default value 
Sql :: sqlite commands 
Sql :: how to get parent and child record in single query using sql 
Sql :: sql duplicate a table with data 
Sql :: start and stop mysql 
Sql :: oracle pl/sql package 
Sql :: declare temp table in sql 
Sql :: oracle grant directory 
Sql :: how to get max from each department in sql 
Sql :: oracle find foreign key dependencies 
Sql :: mariadb create index if not exists 
Sql :: mysql create table if not exists 
Sql :: sql server select record with max id 
Sql :: sql if function 
Sql :: insert data from one database table to another database table in postgresql using pgadmin 
Sql :: insert or update sql query 
Sql :: add sqlite3 in lumen 
Sql :: union syntax in oracle 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =