i want to count 2 tables from diferent table, im select the date then i group it.
here what i try
SELECT
(SELECT date(date), COUNT(sh_sh) FROM sh_url GROUP BY date(date)) AS URLs,
(SELECT date(date), COUNT(ip) FROM tracking GROUP BY date(date)) AS IP
FROM dual
but i get error
1241 - Operand should contain 1 column(s)
is that posible to do it in one command?
the output should be like this
date(url) count(sh_sh) date(ip) count(ip)
--------- ------------ ---------- ----------
2018-04-25 123 2018-04-25 123123
2018-04-26 456 2018-04-26 321
2018-04-27 789 2018-04-27 3125
dateandCOUNT(ip)) intoIP. Get it? You can rewrite this query using aJOIN.