Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql query for getting data with join and count

Correlated subquery

SELECT job_Desc
 ,(select count(*) from employee where employee.job_id = jobs.job_id) as count
FROM Jobs
ORDER BY 2

refrence:
https://azagappan.wordpress.com/2006/06/23/using-count-with-joins/#:~:text=COUNT(*)%20returns%20the%20number,number%20of%20unique%2C%20nonnull%20values.
Comment

PREVIOUS NEXT
Code Example
Sql :: activate log mysql 
Sql :: mysql stored procedure vs function 
Sql :: alter column set not null to null postgres 
Sql :: mysql server not starting in xampp in mac 
Sql :: mysql get nth highest 
Sql :: sql reverse order of results 
Sql :: query to count the number of rows in a table in sqlalchemy 
Sql :: run mysql command from bash 
Sql :: current date in sql 
Sql :: upper case sql 
Sql :: sql character index 
Sql :: mariadb date equals to current_date plus days 
Sql :: sql replace single quote 
Sql :: mysql order by 
Sql :: oracle convert run duration to number 
Sql :: postgresql parse json array 
Sql :: sqlserver add column 
Sql :: oracle nvl 
Sql :: delete row by id mysql 
Sql :: subquery in sql 
Sql :: date sql 
Sql :: show table info mysql 
Sql :: mysql count rows returned 
Sql :: postgresql linux password 
Sql :: image for MSSQL Windows Docker 
Sql :: postgresql function round 
Sql :: postgresql change user role grant 
Sql :: sql server management studio reset cache 
Sql :: mysql run script 
Sql :: sql count more than 1 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =