[PHP-DB] GROUP BY

2011-05-10 Thread Ron Piggott
Is there a way in the query below that the “LEFT OUTER JOIN” connects with only the most recently added entry in `verse_of_the_day_Bible_trivia` for each category ( `verse_of_the_day_Bible_trivia`.`Bible_trivia_category_reference` ) based on the column `verse_of_the_day_Bible_trivia`.`date_adde

Re: [PHP-DB] Group by

2009-12-09 Thread Chris
Philip Thompson wrote: On Dec 9, 2009, at 12:58 PM, h...@deweywilliams.com wrote: The only SELECT is on MAX('timestamp'). There is really nothing to Group BY in this query. Dewey Philip Thompson wrote: Hi. In a mysql query, it is recommended that "GROUP BY" fields be indexed? Using EXPLA

Re: [PHP-DB] Group by

2009-12-09 Thread Philip Thompson
On Dec 9, 2009, at 12:58 PM, h...@deweywilliams.com wrote: > The only SELECT is on MAX('timestamp'). There is really nothing to Group BY > in this query. > > Dewey > > Philip Thompson wrote: >> Hi. >> >> In a mysql query, it is recommended that "GROUP BY" fields be indexed? Using >> EXPLAIN

Re: [PHP-DB] Group by

2009-12-09 Thread h...@deweywilliams.com
The only SELECT is on MAX('timestamp'). There is really nothing to Group BY in this query. Dewey Philip Thompson wrote: Hi. In a mysql query, it is recommended that "GROUP BY" fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY fiel

Re: [PHP-DB] Group by

2009-12-09 Thread Barry Stear
Also you may not see a difference because your not even using 'History_field' anywhere in your SELECT statement. I am a little surprised that you didn't receive a error. On Wed, Dec 9, 2009 at 9:31 AM, Juan Pablo Ramirez < ramirez.juanpa...@gmail.com> wrote: > Hi i recommend always use indexes wh

Re: [PHP-DB] Group by

2009-12-09 Thread Juan Pablo Ramirez
Hi i recommend always use indexes when programming. developers tend not to.. and when the databases grows it's difficult to modify or make them modify the code. El mié, 09-12-2009 a las 14:22 -0300, Julio Araya escribió: > On Wed, Dec 9, 2009 at 12:52 PM, Philip Thompson > wrote: > > Hi. > > >

Re: [PHP-DB] Group by

2009-12-09 Thread Julio Araya
On Wed, Dec 9, 2009 at 12:52 PM, Philip Thompson wrote: > Hi. > > In a mysql query, it is recommended that "GROUP BY" fields be indexed? Using > EXPLAIN on one of my queries, I noticed no change between having indexed by > GROUP BY field and not indexing it. Any thoughts would be appreciated. >

[PHP-DB] Group by

2009-12-09 Thread Philip Thompson
Hi. In a mysql query, it is recommended that "GROUP BY" fields be indexed? Using EXPLAIN on one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it. Any thoughts would be appreciated. In this example, should `history_field` be indexed...? SELECT MAX(

Re: [PHP-DB] GROUP BY

2009-08-17 Thread Ron Piggott
To: "Chris" Cc: "Ron Piggott" ; Sent: Monday, August 17, 2009 6:00 AM Subject: Re: [PHP-DB] GROUP BY ASC after GROUP BY ?? didn't mysql throw an error ? No virus found in

Re: [PHP-DB] GROUP BY

2009-08-17 Thread kranthi
ASC after GROUP BY ?? didn't mysql throw an error ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] GROUP BY

2009-08-16 Thread Chris
Ron Piggott wrote: I run a once daily e-mail list. The users are able to choose the time of day they receive their daily e-mail. Their preference is stored in the email-delivery_hour field. I am trying to determine which email_delivery_hour between 0 and 6 has the lowest number of subscriber

[PHP-DB] GROUP BY

2009-08-16 Thread Ron Piggott
I run a once daily e-mail list. The users are able to choose the time of day they receive their daily e-mail. Their preference is stored in the email-delivery_hour field. I am trying to determine which email_delivery_hour between 0 and 6 has the lowest number of subscribers. (I am trying to m

Re: [PHP-DB] group by day

2005-06-30 Thread Ross Honniball
I have never used the DISTINCT clause, so I won't attempt to help in any detail, but look it up in the manual. I think it will help you. Regards ... Ross Larry Sandwick wrote: Can you help me with this query below Mgr's could circumvent the process by login 20 times in 1 day and change the l

[PHP-DB] group by day

2005-06-29 Thread Larry Sandwick
Can you help me with this query below Mgr's could circumvent the process by login 20 times in 1 day and change the login attempts. This is a rolling 30 window my upper mgmt would like to track. select user, count(user) as num from LoginTrack where user and t='M' and DATE_SUB(CURDATE(),INTER

[PHP-DB] group by date only

2005-06-28 Thread Larry Sandwick
Can you help me with this query below Mgr's could circumvent the process by login 20 times in 1 day and change the login attempts. This is a rolling 30 window my upper mgmt would like to track. select user, count(user) as num from LoginTrack where user and t='M' and DATE_SUB(CU

[PHP-DB] group by

2005-05-24 Thread blackwater dev
Hello, Let's say I have an app used in car garages. I have two tables: table cars id make model table work_done id carid details work_date I need to pull out the last work order for each car. This pulls them all: select c.make, c.model, c.id, wd.details from cars c join work_done wd on wd.car

RE: [PHP-DB] GROUP BY? Urgent help needed with selection list

2005-01-23 Thread Bastien Koert
. Is there anything preventing you from palying with the data and manipulating it on the way into your site? Trying to make the virtual column in to a real column that could provide the geo reference for future queries. Bastien From: "Chris Payne" <[EMAIL PROTECTED]> To: Subject:

Re: [PHP-DB] GROUP BY? Urgent help needed with selection list

2005-01-23 Thread Jochem Maas
Chris Payne wrote: Hi there, The problem is, the database is imported from a huge properties database and can only be imported in the format from the central database of estate agents, so I can't reformat it in the tables itself. Each table has the same fields, but one is for condo's, one is for yo

RE: [PHP-DB] GROUP BY? Urgent help needed with selection list

2005-01-23 Thread Chris Payne
tien >From: "Chris Payne" <[EMAIL PROTECTED]> >To: >Subject: [PHP-DB] GROUP BY? Urgent help needed with selection list >Date: Sun, 23 Jan 2005 00:46:18 -0500 > >Hi there everyone, > > > >I’m using the following code to populate c

RE: [PHP-DB] GROUP BY? Urgent help needed with selection list

2005-01-23 Thread Bastien Koert
if you have kind of geo id number you could use that, failing to have that info, you could re-arrange the data to have Akron - Central, Akron - SE (so that all is in a standard format) Bastien From: "Chris Payne" <[EMAIL PROTECTED]> To: Subject: [PHP-DB] GROUP BY? Urgent

Re: [PHP-DB] GROUP BY? Urgent help needed with selection list

2005-01-22 Thread tg-php
Well, first of all.. your subject line mentions GROUP BY which is a database function for telling the query what to use when performing aggregate functions like sum, count, average, etc type functions. That's really not what you're looking at doing here it sounds like. Sounds like you just wa

[PHP-DB] GROUP BY? Urgent help needed with selection list

2005-01-22 Thread Chris Payne
Hi there everyone, I’m using the following code to populate cities from a huge database: Show All This works great, no problems BUT the client now needs is so the cities are grouped

Re: [PHP-DB] group by get last record

2003-03-16 Thread Bob Hall
On Sun, Mar 16, 2003 at 08:02:02AM +, Daniel Harik wrote: > Hello, > > Guys i try to join to tables > > slides: > id > userid > file > moment > > users > id > username > > As there few slids per user and i want to get only last one, i use following > sql query, but it fetches me first slid

[PHP-DB] group by get last record

2003-03-15 Thread Daniel Harik
Hello, Guys i try to join to tables slides: id userid file moment users id username As there few slids per user and i want to get only last one, i use following sql query, but it fetches me first slide. How can i make it fetch last one please? SELECT slides.file, slides.moment, users.id, us

RE: [PHP-DB] group by day (unix timestamp provided)

2002-10-24 Thread joakim . andersson
> How can I get mySQL to group stuff by the day? my date > coloumn is a UNIX > timestamp. SELECT whatever FROM my_table GROUP BY FROM_UNIXTIME(timestamp_col, '%Y-%m-%d') Regards Joakim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] group by day (unix timestamp provided)

2002-10-24 Thread Noodle Snacks
How can I get mySQL to group stuff by the day? my date coloumn is a UNIX timestamp. -- JJ Harrison [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-12 Thread Mike Gifford
Howdy DL & Jason, I didn't see your response Jason until DL cc'd me this note. Sorry I didn't check back to follow-up on the newsgroup.. I thought I had the answer (well I had one, but not quite the right one).. Dl Neil wrote: > Sorry, I haven't been keeping close track of the list - fortunat

Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-12 Thread Mike Gifford
Howdy DL & Jason, I didn't see your response Jason until DL cc'd me this note. Sorry I didn't check back to follow-up on the newsgroup.. I thought I had the answer (well I had one, but not quite the right one).. Dl Neil wrote: > Sorry, I haven't been keeping close track of the list - fortun

Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-12 Thread DL Neil
DL Neil" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: 11 January 2002 20:21 Subject: Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently > It may have been obvious to many, but I stumbled across the solution > (eventually).. > > Changing the while state

Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-11 Thread Mike Gifford
t;Month: " . date ("F", mktime(0,0,0,$InvMonth[$i],1,2002)) > . " Number of Invoices: " . $InvCount[$i] . > ""; > ++$i; > } > > RESULTS: > Month: November Number of Invoices: 17 > Month: December Number of Invoices: 22 > Month: Janu

Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-11 Thread Jason Wong
On Saturday 12 January 2002 00:20, Mike Gifford wrote: > Hello, > > Thanks for your quick reply.. I'm trying to improve the stats feature > for gcdb (a pretty decent little PHP/MySQL accounting package on SF.net) > > On Fri, 2002-01-11 at 05:24, DL Neil wrote: > > Have you posted all of the relev

Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-11 Thread Mike Gifford
ary Number of Invoices: 15 I can't see the bug in the PHP I've got, but there certainly must be one.. Any suggestions would be appreciated! Mike > - Original Message - > From: "Mike Gifford" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sen

Re: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-11 Thread DL Neil
? Please advise, =dn - Original Message - From: "Mike Gifford" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: 11 January 2002 08:12 Subject: [PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently > Hello > > I've got the following SQL Q

[PHP-DB] GROUP BY MONTH(DateBilled) misses an entry consistently

2002-01-11 Thread Mike Gifford
Hello I've got the following SQL Query, which consistently pulls up only 3 out of 4 months from the database: $sql = " SELECT COUNT(DateBilled) AS count, MONTH(DateBilled) AS BilledMonth, YEAR(DateBilled) AS BilledYear FROM Invoices GROUP BY MONTH(DateBilled) ORDER BY DateBilled ASC"; This r

Re: [PHP-DB] GROUP BY with a string column

2001-11-28 Thread Martín Marqués
On Mié 28 Nov 2001 19:42, you wrote: > Can the SUM keyword in SELECT be generalized to strings? > > A tipical use for the SUM keyword is: > > SELECT column1, SUM(column2) > FROM table > GROUP BY column1 > > This works only if column2 contains numbers (and SUM is the mathematical > sum)

[PHP-DB] GROUP BY with a string column

2001-11-28 Thread Mauro Boscarol
Can the SUM keyword in SELECT be generalized to strings? A tipical use for the SUM keyword is: SELECT column1, SUM(column2) FROM table GROUP BY column1 This works only if column2 contains numbers (and SUM is the mathematical sum). What about obtain the same behaviour, when column2

Re: [PHP-DB] Group By problem

2001-08-13 Thread Hugh Bothwell
- Original Message - From: "Sharif Islam" <[EMAIL PROTECTED]> To: "Hugh Bothwell" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, August 13, 2001 11:50 AM Subject: Re: [PHP-DB] Re: Group By problem > But its displaying the same as my code: The SQL was just for reference, to

[PHP-DB] Group By problem

2001-08-13 Thread Sharif Islam
I am trying to caregorize to group at the same time, but its not working. Any hints? Here's my code: $temp="Dummy"; while ($row = mysql_fetch_array($result)) { if($temp !=$row["group_name"]){ $temp=$row["group_name"] ; echo "Group:$temp"; } $temp1="blah"; if($temp1 !=$row["service_cat"]){ $te