Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Govinda
I should have given an example .. select count(*) as record_count, date(column_name) as date_field, 'my_table' as table_name union all select count(*) as record_count, date(column_name) as date_field, 'my_table_2' as table_name and end up with: count | date | table_name

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Govinda
Niel, thanks (I was wondering about that... thought it seemed odd without a FROM clause) Now I have this: $query = SELECT COUNT(*) AS landing_count, date(solarLandingDateTime) AS solarLandingDate, 't7solar_landingALIAS' AS t7solar_landing FROM t7solar_landing GROUP BY

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Ben Dunlap
Can someone point me to understand why? I thought that: SELECT COUNT(*) AS landing_count, date(solarLandingDateTime) AS solarLandingDate, 't7solar_landingALIAS' AS t7solar_landing FROM t7solar_landing GROUP BY DATE(solarLandingDateTime) would, among other thing, assign the number of records

Re: [PHP-DB] 500 records (articles) - SELECT ALL or USE WHERE

2009-08-04 Thread Patrick Price
Just shooting from the hip, I would say the faster method would be to create the 5 different mysql queries. The amount of time taken up by retrieving 500 articles of either blob or text can add up to a significant amount of time, whereas 5 queries that average 10 results per query would result in

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Govinda
Yes, but when you UNION that query with others it gets a bit more complicated ... If you prefer the latter syntax, you can use mysql_fetch_object(). Ben Bless you Ben!! That last post of yours led to my first decent dose of real significant SQL-syntax understanding since I started writing

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Phpster
On Aug 4, 2009, at 6:21 PM, Chris dmag...@gmail.com wrote: Govinda wrote: I should have given an example .. select count(*) as record_count, date(column_name) as date_field, 'my_table' as table_name union all select count(*) as record_count, date(column_name) as date_field,

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Chris
this: - $query = SELECT COUNT(*) AS `CountUniqueDatesInMyTbl`, date(solarLandingDateTime) AS `uniqueDate`, 't7solar_landing' AS `tableAlias` FROM t7solar_landing GROUP BY DATE(solarLandingDateTime) UNION ALL SELECT count(*) AS

Re: [PHP-DB] 500 records (articles) - SELECT ALL or USE WHERE

2009-08-04 Thread Phpster
On Aug 4, 2009, at 7:18 PM, Martin Zvarík mzva...@gmail.com wrote: I need to do about 5 queries: 1) pick the top visited articles 2) pick the recent articles (limit 10) 3) pick the most commented articles etc. Now, I have 2 choices: 1) SELECT ALL records and use PHP for conditions 2) do

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Chris
With a union the columns have to have the same name (or alias). Eg: SELECT COUNT(*) AS count, date(solarLandingDateTime) AS unique_date, 't7solar_landingALIAS' AS origin FROM tablename UNION ALL SELECT count(*) AS count, date(solarAweberConfDateTime) AS unique_date,

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Govinda
Taking this: SELECT count(*) AS `CountUniqueDatesInMyTbl`, date(solarAWDateTime) AS `uniqueDate`, 'aweber_7solar_aw' AS `tableAlias` FROM aweber_7solar_aw GROUP BY DATE(solarAWDateTime) Your query says: get the date() from the solarAWDateTime field then group by that date and give me the date

[PHP-DB] Manlift Qatar – Specialists in Access Platforms and Gene rator Rental

2009-08-04 Thread Manlift Qatar
MANLIFT – NOW IN QATAR ! Introducing the Manlift Group - a leading provider of Temporary Power and Access Platforms Power Rental * Turnkey power solutions ranging from 30kva - 30MW * Containerised gensets by Cummins and Ingersoll Rand * Step-up transformers and ancillary equipment * Logistics