Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql use with to get value counts and percentages

SELECT event, 
       count(event) as event_count,
       count(event) * 100.0 / (select count(*) from event_information) as event_percent
FROM event_information
group by event
Comment

PREVIOUS NEXT
Code Example
Sql :: sql select like 
Sql :: generate series sybase 
Sql :: oracle last connection 
Sql :: sqlyog clear cache query 
Sql :: sql not equal to operator 
Sql :: mql5 list all available symbols 
Sql :: md5 encode oracle 
Sql :: how to do an average on a count sql 
Sql :: if role exists sql 
Sql :: logical operators in sql 
Sql :: Unable to locate package libmysql-java 
Sql :: query inner join 
Sql :: insufficient privileges while creating view in sql oracle 
Sql :: postgresql get difference in hours between two dates 
Sql :: sql track modification 
Sql :: Inser Dataframe into mysql 
Sql :: create table if not exists 
Sql :: generate random data in mysql 
Sql :: sql merge statement 
Sql :: how to get last element sql 
Sql :: mysql copy row with new id 
Sql :: above average salary in sql 
Sql :: sql select statements 
Sql :: delete all from mysql table 
Sql :: update statement postgres 
Sql :: mysql privileges 
Sql :: column must appear in the GROUP BY clause or be used in an aggregate function 
Sql :: how to print out column name differently in mysql 
Sql :: sql stored procedure output parameters 
Sql :: stored procedure 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =