Re: grouping by the difference between values in rows

2014-01-21 Thread hsv
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 100k rows that I have to process if I remove

Re: grouping by the difference between values in rows

2014-01-21 Thread Takeshi Hashimoto
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 the grouping and I think that will be very slow. Anyone have

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 grouping

Re: grouping by the difference between values in rows

2014-01-15 Thread Larry Martell
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 100k rows that I have to process if I

Re: grouping by the difference between values in rows

2014-01-13 Thread Larry Martell
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 the grouping and I think that will be very slow

grouping by the difference between values in rows

2014-01-12 Thread Larry Martell
. 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 the grouping and I think

Re: grouping by the difference between values in rows

2014-01-12 Thread Peter Brawley
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 100k rows that I have to process if I

Re: grouping by the difference between values in rows

2014-01-12 Thread Larry Martell
. 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 aggregating myself. But this query

Re: grouping by the difference between values in rows

2014-01-12 Thread Peter Brawley
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 grouping from the SQL and do all the grouping and aggregating myself

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

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

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 key thing

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) ,

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, although

grouping sorting ordering

2011-04-04 Thread S�ndor Hal�sz
Name, List Membership from PHPLIST2 AS Z WHERE eMail IS NOT NULL GROUP by Q Natheless, I want 'Email' for both names. How can I make it take 'Email' after 'AS' for the grouping? (The outcome is the same whether I write 'Z.email' or 'Email'.) -- MySQL General Mailing List For list archives: http

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 only

Re: joining and grouping

2008-02-28 Thread Olav Mørkrid
-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 you know how to solve it. thanks! -- MySQL General Mailing List For list archives

joining and grouping

2008-02-27 Thread Olav Mørkrid
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: joining and grouping

2008-02-27 Thread Phil
, 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: joining and grouping

2008-02-27 Thread Phil
, 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: joining and grouping

2008-02-27 Thread Olav Mørkrid
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

Re: grouping

2007-11-03 Thread Brent Baisley
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 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

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

Grouping Question

2007-04-22 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: 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

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 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 contact table looks

RE: Joins versus Grouping/Indexing: Normalization Excessive?

2007-04-03 Thread Jerry Schwartz
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 and I'm doing this in my free time I kinda want to take my

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: 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

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

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 fastest

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 customer B

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

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,

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

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.ID

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)

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: 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

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

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

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 - actually I

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

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

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

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 think you mean to say that your table has 3

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: Grouping based on state changes

2004-09-22 Thread Michael Stassen
)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 time

Re: Grouping based on state changes

2004-09-22 Thread SGreen
(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 time

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

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-20

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 10:46:12 |

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 emierzwa
with 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 | recdate | mount | perused

select statement for syslog like grouping of messages

2004-05-04 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 - ORDER BY

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

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

Time zones and grouping

2003-10-14 Thread Graeme B. Davis
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://lists.mysql.com/[EMAIL PROTECTED] | | -- MySQL

Re: Time zones and grouping

2003-10-14 Thread Mikhail Entaltsev
] 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). I store dates as GMT in the db, but sometimes I want to count the number

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: User Grouping and Priveleges in MySQL

2003-10-13 Thread Director General: NEFACOMP
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 Minky - Original Message - From: Director General

Re: User Grouping and Priveleges in MySQL

2003-10-13 Thread Paul DuBois
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 and Priveleges in MySQL The simple answer is no. MySQL is first and foremost

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: 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 I have a very

RE: sorting/grouping

2003-10-06 Thread Cummings, Shawn (GNAPs)
:[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... commentid is the ID (each new record is a higher #).. and the commentref field

RE: sorting/grouping

2003-10-06 Thread Cummings, Shawn (GNAPs)
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 very simple table. commentid, commentref (each field is an INT) Each

Re: sorting/grouping

2003-10-06 Thread Joseph Bueno
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 very simple table. commentid

RE: sorting/grouping

2003-10-06 Thread Paul DuBois
: 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... commentid is the ID (each new record is a higher

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 Alec . Cawley
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... commentid is the ID (each new record is a higher #).. and the commentref field if the story the comment refers to. I

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://order.mysql.com/?ref=ensita

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. If you want the data

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

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 first email

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
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

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]

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

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:

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

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 | ++---++ | 96-655

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 always found

RE: grouping / sorting etc..

2003-07-14 Thread Rudy Metzger
:[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 | | | 4 | BAD | | 5

Re: grouping / sorting etc..

2003-07-14 Thread Krasimir_Slaveykov
: 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 it's

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 / sorting

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

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 offer

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

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

2002-09-23 Thread gerald_clark
| | 447781484245 | | 447967305499 | | 447812106198 | | 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

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='2

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

Re: Date Interval Grouping

2002-03-27 Thread DL Neil
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 database. SELECT tblVisitorHits.vIP, tblVisitorHits.vDateTime

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 trying to design a little browser/ip tracking page

Date Interval Grouping

2002-03-26 Thread pietrzyk
). 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, tblVisitorHits.vDateTime

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

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(timestamp)

Grouping behavior question

2001-11-01 Thread Jerry van Leeuwen
of grouping on a primary table? I tried selecting a MAX on the timestamp field, in the hope that somehow the resolution of that maximum would leave the other fields in the record sticky to the position that the maximum was found... with no success... I really would like to avoid changing the structure

  1   2   >