Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql get count of rows

SELECT COUNT(*) FROM my_table;
SELECT COUNT(*) FROM my_table WHERE my_column IS NULL;
SELECT COUNT(*) FROM my_table WHERE my_column = 'my_value';
SELECT COUNT(DISTINCT tel) gender_count,
       COUNT(DISTINCT CASE WHEN gender = 'male'   THEN tel END) male_count,
       COUNT(DISTINCT CASE WHEN gender = 'female' THEN tel END) female_count
FROM people;
Comment

mysql count rows returned

select count(*) from (select * from foo) as x;
Comment

PREVIOUS NEXT
Code Example
Sql :: update column value in sql 
Sql :: alter table query sql server change column 
Sql :: oracle concat datetime 
Sql :: mysql biginteger size 
Sql :: all tables and views oracle 
Sql :: postgresql linux password 
Sql :: Get all index postgres 
Sql :: how to run sql server on mac 
Sql :: image for MSSQL Windows Docker 
Sql :: sql power function 
Sql :: Using GROUP BY in MySQL Join Table 
Sql :: postgres describe table 
Sql :: import mysql database command line linux 
Sql :: sqlalchemy get schema from database 
Sql :: mysql find_in_set join 
Sql :: oracle create table as select 
Sql :: mysql run script 
Sql :: like in postgresql 
Sql :: select odd records sql 
Sql :: SQL Remove Primary Key Constraint - MySQL 
Sql :: sql join 
Sql :: sql datum formatieren 
Sql :: how to make case insensitive in sql 
Sql :: psql check if value in array 
Sql :: psql check tables command 
Sql :: connecting to postgresql on windows amd ubuntu 20.04 
Sql :: how to delete user sql server 
Sql :: order by sql query 
Sql :: distinct in sql 
Sql :: mysql update 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =