Re: grouping by the difference between values in rows

2014-01-21 Thread Takeshi Hashimoto
combined. > > In python I can easily parse the data and identify the rows that need > to be combined, but then I've lost the ability to calculate the > average and std. The only way I can think of to do this is to remove > the grouping from the SQL and do all the grouping and aggreg

Re: grouping by the difference between values in rows

2014-01-21 Thread hsv
ntify the rows that need to be combined, but then I've lost the ability to calculate the average and std. The only way I can think of to do this is to remove the grouping from the SQL and do all the grouping and aggregating myself. But this query often returns 20k to 30k rows after grouping. It c

Re: grouping by the difference between values in rows

2014-01-15 Thread Larry Martell
>>>>> row 5: 5.1, 10.1 >>>>> row 6: 6.0, 7.9 >>>>> row 7: 8.0, 21.0 >>>>> row 8: 100, 200 >>>>> >>>>> 1 through 6 get combined because all their X values are within the >>>>> tolerance of som

Re: grouping by the difference between values in rows

2014-01-15 Thread shawn l.green
the X or Y value is within the tolerance of any X or Y in the set that was combined. In python I can easily parse the data and identify the rows that need to be combined, but then I've lost the ability to calculate the average and std. The only way I can think of to do this is to remove the g

Re: grouping by the difference between values in rows

2014-01-13 Thread Larry Martell
ause all their X values are within the >>>> tolerance of some other X in the set that's been combined. 7's Y value >>>> is within the tolerance of 2's Y, so that should be combined as well. >>>> 8 is not combined because neither the X or Y value is w

Re: grouping by the difference between values in rows

2014-01-12 Thread Peter Brawley
the set that was combined. In python I can easily parse the data and identify the rows that need to be combined, but then I've lost the ability to calculate the average and std. The only way I can think of to do this is to remove the grouping from the SQL and do all the grouping and aggre

Re: grouping by the difference between values in rows

2014-01-12 Thread Larry Martell
t that's been combined. 7's Y value >> is within the tolerance of 2's Y, so that should be combined as well. >> 8 is not combined because neither the X or Y value is within the >> tolerance of any X or Y in the set that was combined. >> >> In python I can

Re: grouping by the difference between values in rows

2014-01-12 Thread Peter Brawley
e combined, but then I've lost the ability to calculate the average and std. The only way I can think of to do this is to remove the grouping from the SQL and do all the grouping and aggregating myself. But this query often returns 20k to 30k rows after grouping. It could easily be 80k to 10

grouping by the difference between values in rows

2014-01-12 Thread Larry Martell
ty to calculate the average and std. The only way I can think of to do this is to remove the grouping from the SQL and do all the grouping and aggregating myself. But this query often returns 20k to 30k rows after grouping. It could easily be 80k to 100k rows that I have to process if I remove th

Re: grouping and limiting results and rand()

2013-09-23 Thread Peter Brawley
On 2013-09-23 8:10 PM, Jeremiah Jester wrote: Hello, How would i go about selecting 5 random cars that are flagged as internet_special (value 1) for each dealer from a specific table? Ive tried sub selects with no luck. Here's a basic query that has my required conditional. Note that I get all

grouping and limiting results and rand()

2013-09-23 Thread Jeremiah Jester
Hello, How would i go about selecting 5 random cars that are flagged as internet_special (value 1) for each dealer from a specific table? Ive tried sub selects with no luck. Here's a basic query that has my required conditional. Note that I get all unique dealers by doing a distinct(dealer_web_na

Re: Ordering by grouping

2011-04-09 Thread S�ndor Hal�sz
2011/04/08 17:12 -0400, Michael Dykman Mildly surprised this is working at all. Your name alias fields like "When" should be quoted by back-tics, no double quotes.. this is a clarification and does not solve the issue really although it might make your final result less surprising. A

Re: Ordering by grouping

2011-04-08 Thread Michael Dykman
Mildly surprised this is working at all. Your name alias fields like "When" should be quoted by back-tics, no double quotes.. this is a clarification and does not solve the issue really although it might make your final result less surprising. A key thing to note about GROUP BY is that, althoug

Ordering by grouping

2011-04-08 Thread hsv
Once more I am surprised by the ordering that I get from 'GROUP BY'. This defines the table of directors that have been on the board: CREATE TABLE DIRECTOR ( Chosen DATE NOT NULL , Through DATE NOT NULL , MemberIDINTEGER REFERENCES MemberAddress (MemberID) , CONST

grouping sorting ordering

2011-04-04 Thread S�ndor Hal�sz
After more fooling around, I found that this yields something ordered by the first field: select REPLACE(eMail, '- ', '') AS Email, IFNULL(foreignKey, '') AS "Foreign Key", "Full Name", "List Membership" from PHPLIST2 AS Z WHERE eMail IS NOT NULL GROUP by REPLACE(eMail, '- ', '') Is this the on

grouping sorting ordering

2011-04-04 Thread S�ndor Hal�sz
first field: select REPLACE(eMail, '- ', '') AS Q, IFNULL(foreignKey, '') AS "Foreign Key", "Full Name", "List Membership" from PHPLIST2 AS Z WHERE eMail IS NOT NULL GROUP by Q Natheless, I want 'Email' for both names. How can

Re: joining and grouping

2008-02-28 Thread Olav Mørkrid
idate from vote where voter = '$me'; > > > > > > > > most popular: > > > > select candidate from vote group by candidate order by count(*) desc; > > > > > > > > sub-select: > > > > select candidate from vote where candida

Re: joining and grouping

2008-02-27 Thread Phil
select candidate from vote where voter = '$me'; > > > > > > most popular: > > > select candidate from vote group by candidate order by count(*) desc; > > > > > > sub-select: > > > select candidate from vote where candidate not in (select candidate

Re: joining and grouping

2008-02-27 Thread Olav Mørkrid
ote group by candidate order by count(*) desc; > > > > sub-select: > > select candidate from vote where candidate not in (select candidate > > from vote where voter = '$me') group by candidate order by count(*) > > desc; > > > > however, sub-selects are ve

Re: joining and grouping

2008-02-27 Thread Phil
voter = '$me') group by candidate order by count(*) > desc; > > however, sub-selects are very slow, so i need to find a speedy way. > i'm familiar with joins, but don't know how to use it for this case > where grouping is involved. > > please get in touch if

joining and grouping

2008-02-27 Thread Olav Mørkrid
very slow, so i need to find a speedy way. i'm familiar with joins, but don't know how to use it for this case where grouping is involved. please get in touch if you know how to solve it. thanks! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: grouping

2007-11-03 Thread Brent Baisley
symbols (grouping by symbols) between 2 specified dates, and calculate the percent of change for each symbol. The percent of change is (the value from the last date of the symbol - the value from the first date) / the value from the first date. For example I have: SMB1, 2007-01-01, 1000

Re: grouping

2007-11-02 Thread Baron Schwartz
Hi, Octavian Rasnita wrote: Hi, I have a table with the following columns: symbol date value I want to select all the symbols (grouping by symbols) between 2 specified dates, and calculate the percent of change for each symbol. The percent of change is (the value from the last date of the

grouping

2007-11-02 Thread Octavian Rasnita
Hi, I have a table with the following columns: symbol date value I want to select all the symbols (grouping by symbols) between 2 specified dates, and calculate the percent of change for each symbol. The percent of change is (the value from the last date of the symbol - the value from the

Re: Grouping Question

2007-04-22 Thread YL
Thanks a lot CJ. That's the cost of flexibility:-) - Original Message - From: Christian High To: YL Cc: mysql@lists.mysql.com Sent: Sunday, April 22, 2007 12:45 PM Subject: Re: Grouping Question On 4/22/07, YL <[EMAIL PROTECTED]> wrote: I have a co

Re: Grouping Question

2007-04-22 Thread Christian High
On 4/22/07, Christian High <[EMAIL PROTECTED]> wrote: On 4/22/07, YL <[EMAIL PROTECTED]> wrote: > > I have a contact table looks like > > id type owner_idowner_type value > 11email21 person [EMAIL PROTECTED] > 12phone 21

Re: Grouping Question

2007-04-22 Thread Christian High
On 4/22/07, YL <[EMAIL PROTECTED]> wrote: I have a contact table looks like id type owner_idowner_type value 11email21 person [EMAIL PROTECTED] 12phone 21 person 303-777- 13PO Box18

Grouping Question

2007-04-21 Thread YL
I have a contact table looks like id type owner_idowner_type value 11email21 person [EMAIL PROTECTED] 12phone 21 person 303-777- 13PO Box18 business 220 14cell

RE: Joins versus Grouping/Indexing: Normalization Excessive?

2007-04-03 Thread Jerry Schwartz
: Tuesday, April 03, 2007 12:15 AM > To: mysql@lists.mysql.com > Subject: Joins versus Grouping/Indexing: Normalization Excessive? > > So I'm currently designing a database for a web site and > intra net for my > campuses student radio. Since I'm not getting paid for this >

Re: Joins versus Grouping/Indexing: Normalization Excessive?

2007-04-02 Thread Micah Stevens
I think you're approaching this from the wrong angle. You'll want to put the data at the highest level at which it changes. i.e. If every song on an album is always the same year, put it at the album level, however, if it changes from song to song on a particular album, then you want it at the

Joins versus Grouping/Indexing: Normalization Excessive?

2007-04-02 Thread Daniel Cousineau
So I'm currently designing a database for a web site and intra net for my campuses student radio. Since I'm not getting paid for this and I'm doing this in my free time I kinda want to take my time and have the system setup as "perfectly" as any one college student can. I'm currently debating on

Re: grouping

2007-02-10 Thread Peter Brawley
>select column1, column2, max(column3) as maximum >from table_name group by column 1; >Please tell me if the values from "column2" will contain the values from >those records where the column3 has the maximum value. They will not. >please tell me how to do this as fast as possible. What's fast

grouping

2007-02-10 Thread Octavian Rasnita
Hi, I want to use: select column1, column2, max(column3) as maximum from table_name group by column 1; Please tell me if the values from "column2" will contain the values from those records where the column3 has the maximum value. If it doesn't, please tell me how to do this as fast as possi

Grouping and summering

2006-12-07 Thread Jonas Rosling
Hi, I'm not that used to MySQL, yet. I wonder if it's possible to do the following grouping with summery on a record set? Tha records set looks as follows: - type - topic - description - time Example of data: Admin Email Email to customer A 0,25 Admin Email Email to

Re: Updating One Table With the Sum() of a Grouping From Another...

2006-11-22 Thread John Kopanas
Ahhh... I did the following: UPDATE companies c SET total_annual_service_charge = (SELECT SUM(annual_service_charge) FROM purchased_services ps WHERE ps.company_id = c.id); What think you? :-) On 11/22/06, John Kopanas <[EMAIL PROTECTED]> wrote: I have two tables: companies, purchased_services

Updating One Table With the Sum() of a Grouping From Another...

2006-11-22 Thread John Kopanas
I have two tables: companies, purchased_services... for each company in the companies table I want to sum up the annual_service_charge for each row that is associated with teh company in purchased_services. I have the following query: SELECT company_id, SUM(annual_service_charge) FROM purchased_

Re: Joining multiple tables with grouping functions

2006-05-26 Thread Jay Pipes
Ville Mattila wrote: I try to get a list of all Invoices with total sum of the invoice and paid sum of each invoices, as well as a customer name. I try following query: SELECT Invoices.*, SUM(InvoiceContents.Amount * InvoiceContents.Price) AS InvoiceTotal, Customers.Name, SUM(Payments.Amount) Pa

Re: Joining multiple tables with grouping functions

2006-05-26 Thread Peter Brawley
Ville, >SELECT Invoices.*, SUM(InvoiceContents.Amount * InvoiceContents.Price) >AS InvoiceTotal, Customers.Name, SUM(Payments.Amount) PaidTotal, >MAX(Payments.Date) LastPayment FROM Invoices LEFT JOIN InvoiceContents >ON (InvoiceContents.InvoiceID = Invoices.ID) LEFT JOIN Customers ON >(Customers

Joining multiple tables with grouping functions

2006-05-26 Thread Ville Mattila
Hello all, I'm sure that this situation is one of the most wondered questions with JOIN clauses. Anyway, I couldn't find any clear information how to carry out multiple joins in one query with proper results. I have four tables: 1. Invoices 2. InvoiceContents 3. Customers 4. Payments I try to ge

Re: Sort before grouping

2006-01-30 Thread Michael Stassen
David Förster wrote: Hi, is there any way to get datasets sorted before they're grouped by GROUP BY()? I have a table of events at different locations and want to select the newest one for each location. However "SELECT * FROM events GROUP BY location ORDER BY date DESC" gives me just some eve

Re: Sort before grouping

2006-01-30 Thread Peter Brawley
David, I have a table of events at different locations and want to select the newest one for each location. Famous & oft-asked, how to retrieve a groupwise-max values. See http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html PB - David Förster wrote: Hi, is t

Sort before grouping

2006-01-30 Thread David Förster
Hi, is there any way to get datasets sorted before they're grouped by GROUP BY()? I have a table of events at different locations and want to select the newest one for each location. However "SELECT * FROM events GROUP BY location ORDER BY date DESC" gives me just some event per location and the

Re: Probelm with date grouping

2005-12-02 Thread SGreen
"Shaun" <[EMAIL PROTECTED]> wrote on 12/02/2005 10:09:44 AM: > Hi, > > I am having a problem with using dates grouped by week where it spans over 2 > months. I would like the query to return all hours worked by week number, > however week 48 is causing problems because it spans 2 months - act

Probelm with date grouping

2005-12-02 Thread Shaun
Hi, I am having a problem with using dates grouped by week where it spans over 2 months. I would like the query to return all hours worked by week number, however week 48 is causing problems because it spans 2 months - actually I am presuming this is the problem! mysql> SELECT DATE_FORMAT(T.Da

Re: ORDERing/GROUPing or both??

2005-04-29 Thread SGreen
How do you determine "most recent"? Is it based on the highest ID number for a person or some datetime value you didn't show us? This is another form of the groupwise maximum problem described here: http://dev.mysql.com/doc/mysql/en/example-maximum-column-group-row.html If after reading the do

ORDERing/GROUPing or both??

2005-04-29 Thread Cummings, Shawn (GNAPs)
If I have a table with fields ID, NAME, VALUE and they may be populated like 1, SHAWN, APPLE 2, TOM, BANANA 3, SHAWN, BANANA 4, JACK, GRAPES 5, TOM, APPLE 6, SHAWN, GRAPES and I want to query all records showing only the most recent records for each person Any thoughts? -- MySQL General Mai

Re: Order By When Grouping

2004-12-19 Thread Rhino
- Original Message - From: "Jalil Feghhi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, December 19, 2004 3:37 PM Subject: Order By When Grouping > Let's say I have a table w/ three rows: ID, Time, and Name. when I do: > First of all, I thin

Order By When Grouping

2004-12-19 Thread Jalil Feghhi
Let's say I have a table w/ three rows: ID, Time, and Name. when I do: select Time, Name group by Name Order By Time MySQL selects one of the Time fields if there are rows with the same Name and then does the ordering using this selected field (I am not sure what is the logic but it seems it is

Re: Grouping based on state changes

2004-09-22 Thread SGreen
es data: > > ID (int) time (DATETIME)state (int)value (int) > > I want to make a state based grouping and calculate the mean of > each grouping. The state based grouping should be done by creating a new > group whenever the state changes, from one point in time to another.

Re: Grouping based on state changes

2004-09-22 Thread Michael Stassen
TETIME)state (int)value (int) I want to make a state based grouping and calculate the mean of each grouping. The state based grouping should be done by creating a new group whenever the state changes, from one point in time to another. To explain what I mean I have made a small example: ID

Grouping based on state changes

2004-09-22 Thread mads
I have the following table definition for time series data: ID (int) time (DATETIME)state (int)value (int) I want to make a state based grouping and calculate the mean of each grouping. The state based grouping should be done by creating a new group whenever the state changes, from

RE: Query help with grouping and latest date.

2004-05-20 Thread emierzwa
grouping and latest date. On Thursday 20 May 2004 12:49, Egor Egorov might have typed: > Duncan Hill <[EMAIL PROTECTED]> wrote: > > I have a table that has data that looks like: > > ++-+---+-+ > > > > | id | recd

Re: Query help with grouping and latest date.

2004-05-20 Thread Duncan Hill
On Thursday 20 May 2004 12:49, Egor Egorov might have typed: > Duncan Hill <[EMAIL PROTECTED]> wrote: > > I have a table that has data that looks like: > > ++-+---+-+ > > > > | id | recdate | mount | perused | > > > > ++-+-

Re: Query help with grouping and latest date.

2004-05-20 Thread Egor Egorov
Egor Egorov <[EMAIL PROTECTED]> wrote: > Duncan Hill <[EMAIL PROTECTED]> wrote: >> I have a table that has data that looks like: >> ++-+---+-+ >> | id | recdate | mount | perused | >> ++-+---+-+ >> | 1 | 2004-05-20

Re: Query help with grouping and latest date.

2004-05-20 Thread Egor Egorov
Duncan Hill <[EMAIL PROTECTED]> wrote: > I have a table that has data that looks like: > ++-+---+-+ > | id | recdate | mount | perused | > ++-+---+-+ > | 1 | 2004-05-20 10:46:12 | QUAR | 80 | > | 2 | 2004-05

Query help with grouping and latest date.

2004-05-20 Thread Duncan Hill
I have a table that has data that looks like: ++-+---+-+ | id | recdate | mount | perused | ++-+---+-+ | 1 | 2004-05-20 10:46:12 | QUAR | 80 | | 2 | 2004-05-20 11:05:11 | QUAR | 99 | | 2 | 2004-05-20

select statement for syslog like grouping of messages

2004-05-03 Thread Andreas Heckwolf
Dear all, I do have a logging table with the fields: id, error_id, logtime and message. I am trying to create a consolidated list of log messages, syslog like, where consecutive, identical messages are combined and replaced by for example: "Last message repeated 5 times". Anyone done this? Any

Grouping problem

2004-04-05 Thread Batara Kesuma
Hi, Can I ask MySQL to GROUP BY id on MAX(something). For example, the query below: mysql> SELECT diary.date, diary.time, diary.id AS diary_id, diary.title, -> link.to_id AS friend_id -> FROM link -> JOIN diary ON diary.member_id = link.to_id -> WHERE link.from_id=10 -> ORD

grouping

2003-11-10 Thread Cummings, Shawn (GNAPs)
select max(comments.commentid) as tagger, comments.commentref, article.articlesubject, article.articlename, comments.commentfrom from comments LEFT JOIN article ON comments.commentref=article.articleid GROUP BY commentref ORDER by tagger DESC; I have this query above. I lists comments in ord

SUMmarizing/GROUPing over UNION SELECT?

2003-11-04 Thread Ivo
Is it possible to summarize and group over a result set derived from several different tables using UNION SELECT? For example, this is what I have: Table1.field1 1 2 3 4 5 5 Table2.field1 1 2 3 3 And what I want to get is something like this: 1) SUM=29 2) A result set like this by grouping

Re: Time zones and grouping

2003-10-14 Thread Mikhail Entaltsev
t;[EMAIL PROTECTED]> To: "Graeme B. Davis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, October 14, 2003 2:36 PM Subject: Time zones and grouping > Does anyone know any way to be able to group by day/week/month for an > adjusted date (GMT -> EDT). >

Time zones and grouping

2003-10-14 Thread Graeme B. Davis
ve run into a problem when you want to GROUP BY | DAYOFYEAR(datefield) for example, I want it to do the grouping by EDT | and not GMT -- is this possible? | | Regards, | | Graeme | | | -- | MySQL General Mailing List | For list archives: http://lists.mysql.com/mysql | To unsubscribe: http

Re: User Grouping and Priveleges in MySQL

2003-10-13 Thread Paul DuBois
of manually changing for every user. If I am not clear, I will rephrase the question again! Thanks Emery - Original Message - From: <[EMAIL PROTECTED]> To: "Director General: NEFACOMP" <[EMAIL PROTECTED]> Sent: Monday, October 13, 2003 15:24 Subject: Re: User Grouping an

Re: User Grouping and Priveleges in MySQL

2003-10-13 Thread Director General: NEFACOMP
; Sent: Monday, October 13, 2003 15:24 Subject: Re: User Grouping and Priveleges in MySQL > The simple answer is no. MySQL is first and foremost a Linux/UNIX and the > MySQL Management do not care to much about Windows. I should know I used to > work for MySQL AB > > Regards &g

User Grouping and Priveleges in MySQL

2003-10-13 Thread Director General: NEFACOMP
Hi Group, I am wondering whether MySQL is planning to implement Group based privileges. To make my question clear, consider a database where some users are not allowed to update data and other are allowed to update. Will it be possible to create a group that has got some privileges and whenever

RE: sorting/grouping

2003-10-06 Thread Alec . Cawley
Cummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] > > Sent: Thursday, October 02, 2003 2:37 PM > > To: [EMAIL PROTECTED] > > Subject: sorting/grouping > > > > > > > > > > I have a very simple table. > > > > commentid, commentref (each field i

RE: sorting/grouping

2003-10-06 Thread Paul DuBois
At 12:09 -0400 10/6/03, Cummings, Shawn (GNAPs) wrote: For instance; mysql> select commentid, commentref from comments GROUP BY commentref ORDER by commentref DESC, commentid; +---++ | commentid | commentref | +---++ |80 |188 | |73 |

RE: sorting/grouping

2003-10-06 Thread Paul DuBois
,commentid DESC; -Original Message- From: Cummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 2:37 PM To: [EMAIL PROTECTED] Subject: sorting/grouping I have a very simple table. commentid, commentref (each field is an INT) Each record is a comment... c

Re: sorting/grouping

2003-10-06 Thread Joseph Bueno
: try select commentid, commentref from comments ORDER by commentref ,commentid DESC; > -Original Message- > From: Cummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 2:37 PM > To: [EMAIL PROTECTED] > Subject: sorting/grouping > &

RE: sorting/grouping

2003-10-06 Thread Cummings, Shawn (GNAPs)
commentid, commentref from comments ORDER by commentref ,commentid DESC; > -Original Message- > From: Cummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 2:37 PM > To: [EMAIL PROTECTED] > Subject: sorting/grouping > > > > > I have a v

RE: sorting/grouping

2003-10-06 Thread Cummings, Shawn (GNAPs)
ummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 2:37 PM > To: [EMAIL PROTECTED] > Subject: sorting/grouping > > > > > I have a very simple table. > > commentid, commentref (each field is an INT) > > Each record is a comment... commen

RE: sorting/grouping

2003-10-06 Thread Dan Greene
try select commentid, commentref from comments ORDER by commentref ,commentid DESC; > -Original Message- > From: Cummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 2:37 PM > To: [EMAIL PROTECTED] > Subject: sorting/grouping > &

sorting/grouping

2003-10-06 Thread Cummings, Shawn (GNAPs)
I have a very simple table. commentid, commentref (each field is an INT) Each record is a comment... commentid is the ID (each new record is a higher #).. and the commentref field if the "story" the comment refers to. I want to be able to list the stories in order from "most recent comment"

Re: Custom/conditional grouping?

2003-09-24 Thread David Garamond
Bruce Feist wrote: David Garamond <[EMAIL PROTECTED]> wrote: CREATE TABLE `payments` ( `date` date NOT NULL, `payee` varchar(255), `amount` double ) The 'payments' table records the amount of money that should be paid to each person every month. But the actual cheque is only given when

Re: Custom/conditional grouping?

2003-09-24 Thread David Garamond
Haydies wrote: That was an amazingly vage question. Yup, sorry for that. Accidentally sent :) -- dave -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Custom/conditional grouping?

2003-09-24 Thread David Garamond
Victoria Reznichenko wrote: David Garamond <[EMAIL PROTECTED]> wrote: Can I do this with in pure SQL (instead of having to create logic in programming language)? What do you mean "Custom/conditional grouping"? Please, be more detailed. Sorry, please refer to my other post. The

Re: Custom/conditional grouping?

2003-09-24 Thread Bruce Feist
David Garamond <[EMAIL PROTECTED]> wrote: CREATE TABLE `payments` ( `date` date NOT NULL, `payee` varchar(255), `amount` double ) The 'payments' table records the amount of money that should be paid to each person every month. But the actual cheque is only given when the total accumulat

Re: Custom/conditional grouping?

2003-09-24 Thread Haydies
That was an amazingly vage question. But first thoughts would be yes and no. You can do grouping, but you can't really do it conditionaly with out code. SQL dosn't support much in the way of logic. So, basicly you do the "conditional" part in code, then the grouping with SQL.

Re: Custom/conditional grouping?

2003-09-24 Thread Victoria Reznichenko
David Garamond <[EMAIL PROTECTED]> wrote: > Can I do this with in pure SQL (instead of having to create logic in > programming language)? > What do you mean "Custom/conditional grouping"? Please, be more detailed. -- For technical support contracts, goto https://or

Re: utf8 collations with national symbol's grouping

2003-09-23 Thread Ilja Polivanov
Sorry :) i see that simbols i've written was converted into ASCII symbols. That is what i need, but in MySQL :). So is there any collation where: a = a-umlaut = a-with-any-other-"fix" ? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://list

Custom/conditional grouping? (repost)

2003-09-23 Thread David Garamond
[Sorry for the accidental premature sending in the first post...] CREATE TABLE `payments` ( `date` date NOT NULL, `payee` varchar(255), `amount` double ) INSERT INTO payments VALUES ('2003-05-01','david',38); INSERT INTO payments VALUES ('2003-06-02','david',13.4); INSERT INTO payments VALUE

Custom/conditional grouping?

2003-09-23 Thread David Garamond
Can I do this with in pure SQL (instead of having to create logic in programming language)? Thanks in advance, -- dave -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

utf8 collations with national symbol's grouping

2003-09-21 Thread Ilja Polivanov
Hallo, Is there any UTF8 collation which groups national simbols by it's base symbol.. For example: if in case-insensitive a = A, is there any solution for A = A (a-umlaut) or A ?? it would have sense in search'ing national text's, for example selecting all people in phone book which first surnam

newbie needs help: can I "order by" before "grouping"?

2003-08-07 Thread Michael Winston
I'm having trouble ordering my results before grouping them. I don't want to go into too much detail, so my simplified query without any grouping or ordering results in: ++---++ | jobnum | milestone | shipdate | ++---+

RE: newbie needs help: can I "order by" before "grouping"?

2003-08-06 Thread Kevin Fries
I don't know of any way to sort before the grouping. That would be peculiar, since the GROUP will be eliminating potentially many of those rows. In your case, a simple solution should be: select jobnum, min(milestone), min(shipdate) from jobs group by jobnum order by 2, 3; I've al

RE: grouping / sorting etc..

2003-07-14 Thread Christopher Knight
Thanks for everybody's help!! This way worked for me. Clever! Chris ... and yes... even my example was messed up :-P -Original Message- From: Rudy Metzger [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2003 4:15 AM To: Christopher Knight; MySQL List Subject: RE: grouping / so

Re: grouping / sorting etc..

2003-07-14 Thread Krasimir_Slaveykov
ect: It works correct too. The data in yor excample are 9 records total. To have grouping you must have equal values in columns wich you incuded in group-criteria. You have only 2 records wich have the same values in grouping criteria...so they are grouped. The rest records are different. So i

RE: grouping / sorting etc..

2003-07-14 Thread Rudy Metzger
Knight [mailto:[EMAIL PROTECTED] Sent: vrijdag 11 juli 2003 17:32 To: MySQL List Subject: grouping / sorting etc.. Im having troubles getting the results I want... can someone suggest which way to go.. mysql 4.0 A | 1 | | | 1 | BAD | | 2 | | | 3 | BAD | | 3 | | |

grouping / sorting etc..

2003-07-11 Thread Christopher Knight
Im having troubles getting the results I want... can someone suggest which way to go.. mysql 4.0 A | 1 | | | 1 | BAD | | 2 | | | 3 | BAD | | 3 | | | 4 | BAD | | 5 | | | 5 | BAD | | 5 | BAD | what I want is 5 results. If there is a NULL, then ret

Possible SOLUTION SENDER?? Complex query, grouping and counting challenge

2003-01-09 Thread nospam1001
Believe that a respondent sent an email which appears to have been bounced & deleted before I got a chance to view it. If you are the person, please resend your response! Thank you. === Very complex Grouping and counting challenge Can anyone o

Complex query, grouping and counting challenge

2003-01-07 Thread hturnbull
Very complex Grouping and counting challenge Can anyone offer guidance and suggest SQL which will assist in resolving this complex and challenging (for me) issue? I hope that my attempt to clearly state this problem is successful. The Environment: Queries and presentation using PHP Version

make_set and grouping

2002-10-31 Thread tore . eriksson
labels (or all lables for bit_and). The make_set() function seems to clobber the internal grouping function bit_or(), or is there some other reason this construct is illegal? Tore (using MySQL 4.0.3-beta on Tru64 UNIX)

Re: Help with ordering and grouping with distinct ...

2002-09-23 Thread gerald_clark
-+ >| Destination | >+--+ >| 447812106183 | >| 447775906857 | >| 447781484245 | >| 447967305499 | >| 447812106198 | >| 447812106154 | >| 447781484234 | >| 447775906851 | >| 447967305450 | >+--+ > >How do I do this with an SQL statement? The

Help with ordering and grouping with distinct ...

2002-09-21 Thread Ben Holness
| | 447812106154 | | 447781484234 | | 447775906851 | | 447967305450 | +--+ How do I do this with an SQL statement? The one that I thought would work does not take the most recent timestamp when grouping :( mysql> SELECT DISTINCT Destination, SentDate FROM OutboundMessages WHERE UserID

Help with selecting, grouping and distincting ... May need nested statement?

2002-09-19 Thread Ben Holness
Hi all, I am writing a PHP web page that displays some statistics based on information in a database. The database has a table (stats) with three fields: ID, Sender, Text, UserID, Timestamp I have set it up so that I get basic statistics with the following query: SELECT Text, Count(*) FROM st

Re: Date Interval Grouping

2002-03-27 Thread Bill Easton
try GROUP BY (UNIX_TIMESTAMP(tVH.vDateTime) - MOD(UNIX_TIMESTAMP(tVH.vDateTime, 300))) > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Subject: Date Interval Grouping > Date: Tue, 26 Mar 2002 19:13:44 -0700 > > Ok here's what I trying to do. I am t

Re: Date Interval Grouping

2002-03-27 Thread DL Neil
his like 30 minutes or a full hour). > The reason I want this kind of grouping is that if a person hits the page > constantly for 5 minutes I don't want that to push other relevant IPs down > the listing. Here's what I have to actually select the data from the

Date Interval Grouping

2002-03-26 Thread pietrzyk
full hour). The reason I want this kind of grouping is that if a person hits the page constantly for 5 minutes I don't want that to push other relevant IPs down the listing. Here's what I have to actually select the data from the database. SELECT tblVisitorHits.vIP, tblV

Re: time grouping in mysql

2001-11-03 Thread Paul DuBois
At 9:02 AM -0500 11/3/01, Greg Sarsons wrote: >I haven't succeeded in being able to group by time. My timestamp field >is -mm-dd hh:mm:ss. What I would like is have a query that will >enable me to be to group on events say every 5 minutes. > >I've played around with using time_to_sec(timesta

time grouping in mysql

2001-11-03 Thread Greg Sarsons
I haven't succeeded in being able to group by time. My timestamp field is -mm-dd hh:mm:ss. What I would like is have a query that will enable me to be to group on events say every 5 minutes. I've played around with using time_to_sec(timestamp) to convert all the times to seconds and then gr

  1   2   >