1
I have two tables in my system, and I need to count two columns in the tables. I currently do through a VIEW as follows:
CREATE VIEW totais AS
(SELECT (SELECT COUNT(publications.id) FROM publications) AS total1,
(SELECT COUNT(deejays.id) FROM deejays) AS total2)
I need to do it through a SELECT but I’m not getting it.
And why can’t you use the
VIEW
? I don’t know if you noticed, she’s aSELECT
.– Maniero
@mustache
SELECT COUNT(publications.id) as total1, COUNT(deejays.id) as total2 from publications, deejays
wouldn’t work?– R.Santos
@R.Santos I don’t see why it wouldn’t work ;)
– Maniero