Home > Mobile >  how to select the count of two different things at once in mysql?
how to select the count of two different things at once in mysql?

Time:09-13

Select Count(*), tanggal as totRits And Count(*), total as tNote From tblsolar Where tanggal like '%" & sqlDate & "%' And supir like '%" & cboSupir & "%' Group By tanggal

how to select count two time

CodePudding user response:

This COUNT function is used to find the number of indexes as returned from the query selected.

Please see the below example-

SELECT COUNT(Column1), COUNT(Column2) FROM Table;

CodePudding user response:

If you want to get the total COUNT and a COUNT of a specific column using different conditions, you can use a subquery like this:

SELECT 
  (SELECT 
   COUNT(tanggal) AS totRits
   FROM tblsolar 
   WHERE tanggal LIKE '%sqlDate%' 
   AND supir LIKE '           
  • Related