Thx, actually that didn't work either, but I see now what my problem is, I was using activerecord which in turn add this FROM (nm_visitors bbb) , when I use normal query it is than FROM nm_visitors AS bbb and than it works...
> ----- Original Message ----- > From: "D. Richard Hipp" <[EMAIL PROTECTED]> > To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> > Subject: Re: [sqlite] No such column ? > Date: Mon, 7 Jul 2008 16:44:29 -0400 > > > > On Jul 7, 2008, at 4:37 PM, Milan Nikollic wrote: > > > > SELECT > > COUNT(visitor_id) AS num_visits, > > human_year AS year, > > human_month AS month, > > human_day AS day, > > (SELECT COUNT(DISTINCT ip_address) FROM nm_visitors AS aaa > > WHERE aaa.human_year = bbb.human_year > > AND aaa.human_month = bbb.human_month > > AND aaa.human_day = bbb.human_day) AS num_unique_visits > > FROM nm_visitors AS bbb > > GROUP BY human_year, human_month, human_day > > ORDER BY date DESC LIMIT 20 > > > > D. Richard Hipp > [EMAIL PROTECTED] > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > = -- Powered by Outblaze _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users