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 :: psql count where not null 
Sql :: sql headers delphi 
Sql :: rails run native ssql query 
Sql :: yii2 mysql ping 
Sql :: sql set auto increment back to 0 
Sql :: check message id sql server 
Sql :: sql current timestamp 
Sql :: error code 1292 mysql workbench 
Sql :: mysql change root password ubuntu 
Sql :: wordpress change user password sql 
Sql :: copy sql table 
Sql :: t sql remove last character from string 
Sql :: sql random sampling per group 
Sql :: Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain duplicates. 
Sql :: describe sql server 
Sql :: ddl materialized view 
Sql :: display total number of tables in mysql 
Sql :: query string starts with vowels 
Sql :: mysql drop trigger 
Sql :: oracle add month 
Sql :: drop table in mysql 
Sql :: find nth highest salary of an employee 
Sql :: ksql terminate all queries 
Sql :: mysql select where text contains 
Sql :: mysql time ago difference 
Sql :: alter table oracle 
Sql :: oracle create as select 
Sql :: mysql select last 10 rows 
Sql :: mysql python 
Sql :: get last week data in mysql 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =