Search
 
SCRIPT & CODE EXAMPLE
 

SQL

find logged in users mysql

SELECT SUBSTRING_INDEX(host, ':', 1) AS host_short,
       GROUP_CONCAT(DISTINCT user) AS users,
       COUNT(*) AS threads
FROM information_schema.processlist
GROUP BY host_short
ORDER BY COUNT(*), host_short;
Comment

PREVIOUS NEXT
Code Example
Sql :: how to know password of mysql root in linux terminal 
Sql :: oracle grants 
Sql :: adding indexing on a db model in mysql using sequelize 
Sql :: HOW TO FIND MEDIAN IN SQL FOR BOTH IDD AND EVEN 
Sql :: sql asynchronous stored procedure call 
Sql :: reset identity column values in sql server 
Sql :: postgresql change value in column 
Sql :: select all field names for a table mysql 
Sql :: mysql alter table set column unique 
Sql :: if not exists insert sql 
Sql :: can you use a where clause for a child query 
Sql :: where date major today mysql 
Sql :: MySQL insert into examble 
Sql :: oracle sysdate 
Sql :: date less than current date sql 
Sql :: sql problems 
Sql :: change default role snowflake 
Sql :: postgres list all stored procedures query 
Sql :: mysql update table from another table 
Sql :: drop foreign key mysql 
Sql :: SELECT table_name FROM user_tables; 
Sql :: postgres change column type to uuid 
Sql :: SQL rounding numbers 
Sql :: sql offset 
Sql :: postgres add column integer 
Sql :: change default schema sql server 
Sql :: amazon linux postgresql client 
Sql :: sql add two values together 
Sql :: postgres check for foreign key 
Sql :: t-sql merge example 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =