Re: ORDER BY not using index?

2015-07-18 Thread yoku ts.
perhaps assist with the below... I'm not sure at all why my > index aren't being used for the ORDER BY. Currently some 443K records in > the table, but this will grow to a good few million. I simply cannot, > afford a filesort. > > > mysql> SELE

ORDER BY not using index?

2015-07-18 Thread Chris Knipe
Hi, Can someone perhaps assist with the below... I'm not sure at all why my index aren't being used for the ORDER BY. Currently some 443K records in the table, but this will grow to a good few million. I simply cannot, afford a filesort. mysql> SELECT COUNT(*)

Re: Order column in the second table

2014-06-13 Thread Lay András
EXPLAIN SELECT e.id FROM masik m STRAIGHT_JOIN egyik e ON e.id= > m.id WHERE e.duma= 'aaa' ORDER BY m.szam ASC; > ++-+---++---+--+-+-+--+-+ > | id | select_type | table | type | possible_

Re: Order column in the second table

2014-06-12 Thread yoku ts.
Hi, Would you try STRAIGHT_JOIN? mysql56> ALTER TABLE masik DROP KEY idx_test, ADD KEY idx_test(szam, id); Query OK, 0 rows affected (0.08 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql56> EXPLAIN SELECT e.id FROM masik m STRAIGHT_JOIN egyik e ON e.id= m.id WHERE e.duma= 'aa

Re: Order column in the second table

2014-06-12 Thread Lay András
Hi! On Thu, Jun 12, 2014 at 1:36 PM, Antonio Fernández Pérez wrote: > Hi Lay, > > If I don't mistake, you can't eliminate "Using temporary" and "Using > filesort" because you are using an "order by". Try the explain again > removing ord

Re: Order column in the second table

2014-06-12 Thread Antonio Fernández Pérez
​Hi Lay, If I don't mistake, you can't eliminate "Using temporary" and "Using filesort" because you are using an "order by". Try the explain again removing order by and check the output. When you use an order by, MySQL needs to use filesort and spend

Order column in the second table

2014-06-12 Thread Lay András
Hi! I have two tables: CREATE TABLE `egyik` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `duma` varchar(255) NOT NULL, PRIMARY KEY (`id`), KEY `e_idx` (`duma`,`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; INSERT INTO `egyik` VALUES (1,'aaa'),(2,'bbb'); CREATE TABLE `m

Re: MySQL Descending ORDER issue

2013-12-27 Thread Dan Nelson
gt; IN (13528, 14906, 38845)) ORDER BY `date` DESC LIMIT 1;" on 5.1.72 and on > 5.6.15 I get back different data. The date for all of the data are > exactly the same to the second. > > However, if I run "SELECT `table`.* FROM `table` WHERE (credential_id IN > (13528, 14906, 38

RE: MySQL Descending ORDER issue

2013-12-27 Thread Russ Lavoie
T `table_foo`.* FROM `table_foo` WHERE (credential_id IN (13528, 14906, 38845)) ORDER BY `date` DESC LIMIT 1; Thanks! > From: myfriendvi...@gmail.com > Date: Fri, 27 Dec 2013 10:27:28 -0800 > Subject: RE: MySQL Descending ORDER issue > To: russ_lav...@hotmail.com; mysql@lists.mysql.com

RE: MySQL Descending ORDER issue

2013-12-27 Thread Vikas Shukla
Hi Russ, Please share with us the exact details of the table data as well as the o/p. Regards, ViXiD Vikas Shukla Mail Sent from my Windows Phone From: Russ Lavoie Sent: 27-12-2013 23:32 To: mysql@lists.mysql.com Subject: MySQL Descending ORDER issue Hello, I am currently upgrading from mysql

MySQL Descending ORDER issue

2013-12-27 Thread Russ Lavoie
Hello, I am currently upgrading from mysql 5.1.72 -> mysql 5.6 and the migration and upgrade is sound (In a QA ENV). Queries work etc. However, when I run a query similar to "SELECT `table`.* FROM `table` WHERE (some_id IN (13528, 14906, 38845)) ORDER BY `date` DESC LIMIT 1;" on

ORDER ENQUIRY

2013-04-19 Thread joy helen
Hello,   I want to place an order in your store,and i will like to know if you ship to Australia and my method of payment will be credit card.so please let me know if you can assist me with the order ,And please do not forget to include your web page in your replying back to my mail.I will

Re: using LIMIT without ORDER BY

2012-12-13 Thread Johan De Meersman
- Original Message - > From: "Akshay Suryavanshi" > I was referring to a condition when there is no index on the tables, > not even primary keys. If you have a lot of data in there, may I suggest you (temporarily) add a unique index and benchmark both methods? As I said, limit n,m is th

Re: using LIMIT without ORDER BY

2012-12-13 Thread Akshay Suryavanshi
l Message - > > From: "Akshay Suryavanshi" > > > > I am not sure, but if its a MyISAM table, it should be ordered by the > > records insertion order, and in case of InnoDB it should be ordered > > by the clustered index, not necessarily it should be a def

Re: using LIMIT without ORDER BY

2012-12-13 Thread Johan De Meersman
- Original Message - > From: "Akshay Suryavanshi" > > I am not sure, but if its a MyISAM table, it should be ordered by the > records insertion order, and in case of InnoDB it should be ordered > by the clustered index, not necessarily it should be a defined

Re: using LIMIT without ORDER BY

2012-12-12 Thread Akshay Suryavanshi
I am not sure, but if its a MyISAM table, it should be ordered by the records insertion order, and in case of InnoDB it should be ordered by the clustered index, not necessarily it should be a defined one. On Thu, Dec 13, 2012 at 12:58 PM, jiangwen jiang wrote: > hi, all: > >

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread spameden
That's exactly what I thought when reading Michael's email, but tried anyways, thanks for clarification :) 2012/10/16 > 2012/10/16 12:57 -0400, Michael Dykman > your now() statement is getting executed for every row on the select. try > ptting the phrase up front > as in: > set @ut= u

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread hsv
2012/10/16 12:57 -0400, Michael Dykman your now() statement is getting executed for every row on the select. try ptting the phrase up front as in: set @ut= unix_timestamp(now()) and then use that in your statement. Quote: Functions that return the current date or time each are

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread spameden
Interesting thought, but I get the same result. # Query_time: 0.001769 Lock_time: 0.001236 Rows_sent: 0 Rows_examined: 0 use kannel; SET timestamp=1350413592; select * from send_sms FORCE INDEX (priority_time) where time<=@ut order by priority limit 0,11; the MySQL i'm using is 5.5

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread Michael Dykman
iority_time) WHERE time <= UNIX_TIMESTAMP(NOW()) ORDER by priority LIMIT 0,50; 2012/10/16 Shawn Green > On 10/15/2012 7:15 PM, spameden wrote: > >> T...

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread spameden
oxc_id, binfo, meta_data, task_id, msgid FROM send_sms_test FORCE INDEX (priority_time) WHERE time <= UNIX_TIMESTAMP(NOW()) ORDER by priority LIMIT 0,50; 2012/10/16 Shawn Green > On 10/15/2012 7:15 PM, spameden wrote: > >> Thanks a lot for all your comments! >> >> I did

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread Shawn Green
On 10/15/2012 7:15 PM, spameden wrote: Thanks a lot for all your comments! I did disable Query cache before testing with set query_cache_type=OFF for the current session. I will report this to the MySQL bugs site later. First. What are all of your logging settings? SHOW GLOBAL VARIAB

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread spameden
ptimizer's choice. > > ** ** > > *From:* spameden [mailto:spame...@gmail.com] > *Sent:* Monday, October 15, 2012 3:29 PM > > *To:* Rick James > *Cc:* mysql@lists.mysql.com > *Subject:* Re: mysql logs query with indexes used to the slow-log and not > logging if

RE: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread Rick James
From: spameden [mailto:spame...@gmail.com] Sent: Monday, October 15, 2012 3:29 PM To: Rick James Cc: mysql@lists.mysql.com Subject: Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order Sorry, forgot to say: mysql> show variables lik

RE: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread Rick James
y_len; filesort INDEX(priority, time) -- faster; smaller; seems to use both keys of the index (key_len=12); avoids filesort (because INDEX(priority, ...) agrees with ORDER BY priority). The Optimizer has (at some level) two choices: * Start with the WHERE * Start with the ORDER BY

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread spameden
> | 143879 | > +--+ > 1 row in set (0.03 sec) > > Without LIMIT: > mysql> desc select * from send_sms_test FORCE INDEX (time_priority) where > time<=UNIX_TIMESTAMP(NOW()) order by priority; > > ++-+---+---+

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread spameden
* from send_sms_test FORCE INDEX (time_priority) where time<=UNIX_TIMESTAMP(NOW()) order by priority; ++-+---+---+---+---+-+--+---+-+ | id | select_type | table | type | possible_keys | key

RE: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread Rick James
IGINT takes 8 bytes -- usually over-sized. > -Original Message- > From: spameden [mailto:spame...@gmail.com] > Sent: Monday, October 15, 2012 1:42 PM > To: mysql@lists.mysql.com > Subject: mysql logs query with indexes used to the slow-log and not > logging if there is

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread spameden
st FORCE INDEX (time_priority) where time<=UNIX_TIMESTAMP(NOW()) order by priority limit 0,13;* ++-+---+---+---+---+-+--+---+-+ | id | select_type | table | type | possible_keys | key | ke

mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-15 Thread spameden
-gnu on x86_64 ((Percona Server (GPL), 14.0, Revision 475)) If I check with EXPLAIN MySQL says it would use the index: mysql> *desc select * from send_sms_test where time<=UNIX_TIMESTAMP(NOW()) order by priority limit 0,11;* ++-+---+---+---+

RE: UNION and ORDER BY

2012-06-21 Thread Rick James
The parens are for making sure the parsing works correctly. Probably either one works fine. Suggest you do EXPLAIN EXTENDED ...; SHOW WARNINGS; I suspect that the output from each will be identical, and have more parens. The main need for parens is to avoid associating the ORDER BY with

UNION and ORDER BY

2012-06-21 Thread Hal�sz S�ndor
>>>> 2012/06/20 14:32 -0700, Rick James >>>> ( SELECT ruid1, ruid2, overlap FROM l4_link WHERE ruid1=xxx UNION SELECT ruid1, ruid2, overlap FROM l4_link WHERE ruid2=xxx ) ORDER BY overlap DESC; Make it UNION ALL or UNION DISTINCT depending on whether xxx can be in

RE: sort order

2012-05-30 Thread Rick James
Message- > From: Wes James [mailto:compte...@gmail.com] > Sent: Wednesday, May 30, 2012 2:03 PM > To: mysql general discussion > Subject: sort order > > I have mysql 5.1.62-0ubuntu0.11.10.1 installed, but the sort order for > utf8-unicod

Re: sort order

2012-05-30 Thread Wes James
In phpMyAdmin it says the database collation is utf8_unicode_ci and each of the columns is utf8_unicode_ci except the ID primary key column. If you create a simple table with ID and TITLE and put the data below (each row in a record) and run 'select * from table order by title' what

Re: sort order

2012-05-30 Thread Wes James
I'll double check and get back. Thanks, -wes On Wed, May 30, 2012 at 3:43 PM, Carlos Proal wrote: > > Hi Wes, have you double checked you character set and collation ?? > > http://dev.mysql.com/doc/refman//5.5/en/charset-charsets.html > > The collation is which deter

Re: sort order

2012-05-30 Thread Carlos Proal
Hi Wes, have you double checked you character set and collation ?? http://dev.mysql.com/doc/refman//5.5/en/charset-charsets.html The collation is which determines the sorting order. Carlos Proal On Wed, May 30, 2012 at 4:02 PM, Wes James wrote: > I have mysql 5.1.62-0ubuntu0.11.1

sort order

2012-05-30 Thread Wes James
I have mysql 5.1.62-0ubuntu0.11.10.1 installed, but the sort order for utf8-unicode doesn't seem to be right. It is sorting some text like this (order by title): ! ! *`-=[];',./~@#$%^&()_+{}|:"<>?\ !" ![ !@ !a !A !t !test 'Coal age' [ \--\ 10

RE: Help with ORDER BY

2011-02-07 Thread Rolando Edwards
SELECT name, city, state, phone, prods_done, cancels, miles FROM (SELECT name, city, state, phone, prods_done, cancels, miles, ((prod_done - cancels) * 100 / prod_done) reliability FROM volunteer_search WHERE project_id = 5653) A ORDER BY reliability DESC, miles ASC Give it a try !!! Rolando A

Help with ORDER BY

2011-02-07 Thread Richard Reina
ct_id = 5653 ORDER BY miles ASC, cancels/(prods_done/cancels) ASC, prods_done DESC"; The results look something like this: Jim Barnes Chicago, IL 773-555- 2 1 11.5 Kelley Smith Cicero, IL 708-444-2121 3 0 21.6 Kim Ayers Plainfield, IL 630-888-9898 22 1 25.1 I am trying to find a w

RE: Order by "in" clause

2010-11-09 Thread Daevid Vincent
> -Original Message- > From: Joeri De Backer [mailto:fons...@gmail.com] > Sent: Tuesday, November 09, 2010 1:16 AM > To: mysql > Subject: Re: Order by "in" clause > > On Tue, Nov 9, 2010 at 10:09 AM, Mark Goodge > wrote: > > Hi, > > &

Re: Order by "in" clause

2010-11-09 Thread Joeri De Backer
On Tue, Nov 9, 2010 at 10:09 AM, Mark Goodge wrote: > Hi, > > I have a query like this: > > select id, title from product where id in (1,3,5,8,10) > > What I want it to do is return the rows in the order specified in the "in" > clause, so that this: >

Order by "in" clause

2010-11-09 Thread Mark Goodge
Hi, I have a query like this: select id, title from product where id in (1,3,5,8,10) What I want it to do is return the rows in the order specified in the "in" clause, so that this: select * from product where id in (10,3,8,5,1) will give me results in this order: +--+-

RE: ORDER BY with field alias issue

2010-09-29 Thread Daevid Vincent
Easy. SELECT DATE_FORMAT(`Time`, '%h:%i%p') as `Time_Format` FROM `reservation` ORDER BY `Time` > -Original Message- > From: BMBasal [mailto:bmb37...@gmail.com] > Sent: Wednesday, September 29, 2010 3:50 PM > To: 'Chris W'; 'MYSQL General List'

RE: ORDER BY with field alias issue

2010-09-29 Thread BMBasal
It is inherent in your naming. As long as your alias "time" is the same as the column name "time", MySQL will have no way to distinguish which one you refers to exactly in your order-by clause, and chooses the alias in the select-clause as the one you intended. You confused My

Re: ORDER BY with field alias issue

2010-09-28 Thread Johnny Withers
Order by reservation.time JW On Tuesday, September 28, 2010, Chris W <4rfv...@cox.net> wrote: >  I have the following query that is giving me problems. > > SELECT DATE_FORMAT(`Time`, '%h:%i%p') as `Time` > FROM `reservation` > ORDER BY `Time` > > Problem

ORDER BY with field alias issue

2010-09-28 Thread Chris W
I have the following query that is giving me problems. SELECT DATE_FORMAT(`Time`, '%h:%i%p') as `Time` FROM `reservation` ORDER BY `Time` Problem is it sorts wrong because of the date format function output with am and pm. I guess I should have named things differently but I wo

RE: ORDER BY LIMIT issue

2010-08-04 Thread Jerry Schwartz
n Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com >-Original Message- >From: Kristian Davies [mailto:kristian.dav...@gmail.com] >Sent: Wednesday, August 04, 2010 5:03 AM >To: mysql@lists.mysql.com >Subject:

Re: ORDER BY LIMIT issue

2010-08-04 Thread Kristian Davies
> Isn't it so that it firstly order the rows by id (index'ed?) and then scan >  it to pick the rows which satisfy the where clause? > > It stops when the result reaches the limit, otherwise scans the whole (27, > 000 rows scan). > > Then the response time with 2 ro

Re: ORDER BY LIMIT issue

2010-08-04 Thread Eigo Mori
Hi, > With the following query if I it returns 2 results it's fast .04s, if > it has less results than the limit it takes 1minute. > > Query: > select * from hub_dailies_sp where active='1' and date='2010-08-04' > order by id desc LIMIT 2; > >

ORDER BY LIMIT issue

2010-08-04 Thread Kristian Davies
With the following query if I it returns 2 results it's fast .04s, if it has less results than the limit it takes 1minute. Query: select * from hub_dailies_sp where active='1' and date='2010-08-04' order by id desc LIMIT 2; Show create table: http://pastebin.org/447

Re: order by numeric value

2010-04-28 Thread Martijn Tonies
> But I'd prefer not to see the extra sorting field. You don't need to select a field in order to be able to order by it. So select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_entries.debit),0),2)) as Debit, concat(

Re: order by numeric value

2010-04-27 Thread Keith Clark
On Wed, 2010-04-28 at 08:57 +1000, Jesper Wisborg Krogh wrote: > On Wed, 28 Apr 2010 08:53:57 Keith Clark wrote: > > But I'd prefer not to see the extra sorting field. > > You don't need to select a field in order to be able to order by it. > > So > > se

Re: order by numeric value

2010-04-27 Thread Jesper Wisborg Krogh
On Wed, 28 Apr 2010 08:53:57 Keith Clark wrote: > But I'd prefer not to see the extra sorting field. You don't need to select a field in order to be able to order by it. So select chart_of_accounts.accountname as Account, concat('$',format(coalesce(sum(sales_journal_e

RE: order by numeric value

2010-04-27 Thread Keith Clark
---+ > | 1.00 | > +---+ > 1 row in set (0.00 sec) > > > Which in that case, it's better to just select balance without the dollar > sign and order on that column.

RE: order by numeric value

2010-04-27 Thread Gavin Towey
+ | CAST(REPLACE('$1.00','$','') as decimal(8,2)) | +---+ | 1.00 | +---+ 1 row in set (0.00 sec) Which in that case, it's better to just select balance without the dollar sign and ord

Re: order by numeric value

2010-04-27 Thread DaWiz
Try order by CAST(Balance as decimal(8,2)) asc; Cast will work in the order by. Glenn Vaughn - Original Message - From: "Keith Clark" To: Sent: Tuesday, April 27, 2010 3:52 PM Subject: order by numeric value I have the following statement: select chart_of_accounts.a

Re: order by numeric value

2010-04-27 Thread Keith Clark
t; > from sales_journal_entries > > left join sales_journal > > on sales_journal.journalID=sales_journal_entries.journalID > > left join chart_of_accounts > > on chart_of_accounts.accountID=sales_journal_entries.accountID > > where sales_journal.date > '2008-12-31' > > and s

Re: order by numeric value

2010-04-27 Thread Carsten Pedersen
ournal_entries.accountID where sales_journal.date > '2008-12-31' and sales_journal.date < '2010-01-01' group by sales_journal_entries.accountID order by Balance asc; and I'd like the output to be sorted by the Balance according to the numberic value, but it is sorting by the

order by numeric value

2010-04-27 Thread Keith Clark
ere sales_journal.date > '2008-12-31' and sales_journal.date < '2010-01-01' group by sales_journal_entries.accountID order by Balance asc; and I'd like the output to be sorted by the Balance according to the numberic value, but it is sorting by the string resul

Re: Does the order of tuples in a bulk insert impact query performance?

2010-02-07 Thread Tom Worster
On 2/7/10 7:28 AM, "Anthony Urso" wrote: > Does the order of tuples in a bulk insert impact later query > performance? E.g. will sorting the rows before a bulk insert cause > queries to perform better for indexed or non-indexed fields? when i load a large body of data (usin

Does the order of tuples in a bulk insert impact query performance?

2010-02-07 Thread Anthony Urso
Does the order of tuples in a bulk insert impact later query performance? E.g. will sorting the rows before a bulk insert cause queries to perform better for indexed or non-indexed fields? Thanks, Anthony -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

order by-- rollup

2010-02-06 Thread MuraliKrishna
Hi how to use "order by" with "with rollup", if it is not possible is there any alternative, in rollup how to name the null. is there chance to do so. please help me with this..

ORDER BY favours full scan over a faster filesort

2009-12-21 Thread Oscar
.role_id=2556 order by item0_.id desc; mysql version: 5.1.34 have you guys met this problem? thanks, -Oscar -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: Bug? Distinct AS with Order By

2009-10-22 Thread Glyn Astill
> From: Glyn Astill > > Doesn't look crazy to me, and it works in 5.0.32 > > http://www.privatepaste.com/50RvhihKKm > > Perhaps time to patch that server ... > I've guessed at the table def there, obviously your def may be different and that would surely affect the palanners choice. Perhaps

Re: Bug? Distinct AS with Order By

2009-10-22 Thread Glyn Astill
> From: Matt Neimeyer > > Generic code to draw a SELECT element on the screen > sometimes it ends > up like such... > > SELECT DISTINCT name AS myvalue,name AS mydisp FROM names > WHERE > name!="" ORDER BY myvalue > > On 4.1.22 this returns > >

Bug? Distinct AS with Order By

2009-10-22 Thread Matt Neimeyer
I'm not sure what to search on to see if someone has reported this as a bug or if I'm doing something wrong... Generic code to draw a SELECT element on the screen sometimes it ends up like such... SELECT DISTINCT name AS myvalue,name AS mydisp FROM names WHERE name!=""

RE: ALTER TABLE order / optimization

2009-09-04 Thread Rolando Edwards
sage- From: Matt Neimeyer [mailto:m...@neimeyer.org] Sent: Friday, September 04, 2009 3:53 PM To: mysql@lists.mysql.com Subject: ALTER TABLE order / optimization Given table: CREATE TABLE testtab (d_col CHAR(4)); Question 1: It appears that there is no "harm" in just appending directives

ALTER TABLE order / optimization

2009-09-04 Thread Matt Neimeyer
Given table: CREATE TABLE testtab (d_col CHAR(4)); Question 1: It appears that there is no "harm" in just appending directives onto the alter table command even if the order doesn't make sense. It appears the parser figures it out... For example... ALTER TABLE testtab ADD COLU

Re: Hard? query to with group order by group head's name

2009-07-21 Thread Basil Daoust
head-row follewed by the group members with that head (2)head rows are ordered alphabetically by name. What the query looks like? Thanks I hope this is not a school assignment. What I came up with was to create a new order column that I populated with the name of the HEAD. Then I can order by

Re: Hard? query to with group order by group head's name

2009-07-21 Thread Brent Baisley
ame is the current record, sometimes it's a "parent" record, you need to conditional check which type of "record" it is and built the sort value. SELECT tablename.*, IF(tablename.head_id=NULL, CONCAT(tablename.name, tablename.member_id), CONCAT(heads.name, table

Re: Hard? query to with group order by group head's name

2009-07-21 Thread Elim PDT
| +---+---+-+ which not groups correctly. Seems it's a hard query. - Original Message - From: "Darryle Steplight" To: "Elim PDT" Cc: Sent: Wednesday, July 15, 2009 11:50 PM Subject: Re: Hard? query to with group order by group head's name Hi Elim,

Re: what outputs/illustrates a table's structure? - WAS: Re: Hard? query to with group order by group head's name

2009-07-16 Thread Marcus Bointon
On 16 Jul 2009, at 15:26, Govinda wrote: Meaning that on a shared hosting situation, without ssh, then I cannot do that, right? Not necessarily - you can run the client locally and connect to the remote DB. It depends if your host allows remote access to mysql (they might do on request).

Re: what outputs/illustrates a table's structure? - WAS: Re: Hard? query to with group order by group head's name

2009-07-16 Thread Marcus Bointon
On 16 Jul 2009, at 15:02, Govinda wrote: I see such nice formated text output serving to illustrate people's tables and I think it must be due to some code which is spitting that out, rather than people typing so painstakingly. What is that function/MySQL/code? It's the default output f

Re: what outputs/illustrates a table's structure? - WAS: Re: Hard? query to with group order by group head's name

2009-07-16 Thread Govinda
I see such nice formated text output serving to illustrate people's tables and I think it must be due to some code which is spitting that out, rather than people typing so painstakingly. What is that function/MySQL/code? It's the default output format of the mysql command line client, no

what outputs/illustrates a table's structure? - WAS: Re: Hard? query to with group order by group head's name

2009-07-16 Thread Govinda
My table group_member looks like this: +---+---+-+ | member_id | name | head_id | +---+---+-+ | 1 | Elim |NULL | | 2 | Ann | 1 | | 3 | David |NULL | | 4 | John | 3 | | 5 | Jane | 3 | +--

Re: Hard? query to with group order by group head's name

2009-07-15 Thread Darryle Steplight
Hi Elim, I didn't test it out but it sounds like you want to do this " SELECT * FROM group_members GROUP BY head_id, member_id ORDER BY name ASC ". On Thu, Jul 16, 2009 at 1:20 AM, Elim PDT wrote: > My table group_member looks like this: > +---+---+-+

Hard? query to with group order by group head's name

2009-07-15 Thread Elim PDT
My table group_member looks like this: +---+---+-+ | member_id | name | head_id | +---+---+-+ | 1 | Elim |NULL | | 2 | Ann | 1 | | 3 | David |NULL | | 4 | John | 3 | | 5 | Jane | 3 | +---

Re: ignore accents in order by

2009-06-12 Thread Isart Montane
I agree with Per, I use utf8 and it works fine for me, even with Chinese characters On Fri, Jun 12, 2009 at 8:40 AM, Per Jessen wrote: > PJ wrote: > > > Let me put it this way, I am not having the problem. The problem seems > > to be withthe way that character encoding is set up on the internet

Re: ignore accents in order by

2009-06-12 Thread Per Jessen
PJ wrote: > Let me put it this way, I am not having the problem. The problem seems > to be withthe way that character encoding is set up on the internet - > as confused and inconsistent as most everything else. > You can put whatever charset you want in the header, in the collations > in your data

Re: ignore accents in order by

2009-06-11 Thread PJ
Isart Montane wrote: > Hi, > > I'm not having any problem on my local computer > > mysql> select text,text2 from table1 order by text2 desc; > +--+---+ > | text | text2 | > +--+---+ > | a   |    1 | > | �   |    0 | > +--

Re: ignore accents in order by

2009-06-11 Thread Isart Montane
Hi, I'm not having any problem on my local computer mysql> select text,text2 from table1 order by text2 desc; +--+---+ | text | text2 | +--+---+ | a| 1 | | �| 0 | +--+---+ mysql>select text,text2 from table1 order by text2 desc; +--+

ignore accents in order by

2009-06-11 Thread PJ
Is there a way to order lists while ignoring the accents? So far, I have found nothing simple; and I need to keep the accents for output. The language is French (and québécois) :-) TIA -- Hervé Kempf: "Pour sauver la planète, sortez du capita

Re: INNER JOIN order issues.

2009-04-11 Thread Shawn Green
Craig Dunn wrote: Hi, I'm trying to migrate an application from 4.1 to 5.1, theres a bunch of queries that seem to be failing and it looks like the order of INNER JOIN's... for example... SELECTetc INNER JOIN tablex AS x ON y.foo = a.bar INNER JOIN tablea AS a ON y.f

INNER JOIN order issues.

2009-04-07 Thread Craig Dunn
Hi, I'm trying to migrate an application from 4.1 to 5.1, theres a bunch of queries that seem to be failing and it looks like the order of INNER JOIN's... for example... SELECTetc INNER JOIN tablex AS x ON y.foo = a.bar INNER JOIN tablea AS a ON y.foo = b.bar ... works i

Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-12-04 Thread Andy Shellam
ELECT @sn:[EMAIL PROTECTED] sn, id, title FROM t GROUP BY id ORDER BY id desc; | sn | id | title | +--+--+---+ |1 |5 | eee | |2 |4 | ddd | |3 |3 | ccc | |4 |2 | bbb | |5 |1 | aaa | (b) [MySQL 5.0.51a]: DO @sn := 0; SELECT @sn:[EMAIL P

Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-12-04 Thread Nishikant Kapoor
). Thanks, Nishi CREATE TABLE t ( id TINYINT, title VARCHAR(10) ); INSERT INTO t (id, title) VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'), (4, 'ddd'), (5, 'eee'); (a) DO @sn := 0; SELECT @sn:[EMAIL PROTECTED] sn, id, title FROM t G

Re: regular expressions matching only numeric characters in order

2008-12-01 Thread Paul Nowosielski
IL PROTECTED]> To: Paul Nowosielski <[EMAIL PROTECTED]>; mysql@lists.mysql.com Sent: Monday, December 1, 2008 6:42:19 PM Subject: RE: regular expressions matching only numeric characters in order Hi I am a bit of novice at Regexp, but I believe this will work for you (\d+\d+\d+).*(\d+\

regular expressions matching only numeric characters in order

2008-12-01 Thread Paul Nowosielski
Dear All, I'm trying to create a regular expression query to match phone numbers in a database field. My issue is this , the numbers have no set standard for input in the db. So the number in the db could be in multiple formats. EX: 333.333. (333)333- 333-333- 33 So I am wa

Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Nishikant Kapoor
;aaa'), (2, 'bbb'), (3, 'ccc'), (4, 'ddd'), (5, 'eee'); (a) DO @sn := 0; SELECT @sn:[EMAIL PROTECTED] sn, id, title FROM t GROUP BY id ORDER BY id desc; | sn | id | title | +--+--+---+ |1 |5 | eee | |2 |4 | ddd |

Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Nishikant Kapoor
#x27;), (2, 'bbb'), (3, 'ccc'), (4, 'ddd'), (5, 'eee'); (a) DO @sn := 0; SELECT @sn:[EMAIL PROTECTED] sn, id, title FROM t GROUP BY id ORDER BY id desc; | sn | id | title | +--+--+---+ |1 |5 | eee | |2 |4 | ddd | |

Re: Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Andy Shellam
Hi Nishi, There was a bug in that version that affected the sort order when combined with a group by statement (http://bugs.mysql.com/bug.php?id=32202.) There are a couple of workarounds but they are bad (e.g. removing primary key!) I would strongly suggest you upgrade to 5.0.67 or

Maintaining sort order with 'GROUP BY' and 'HAVING'

2008-11-27 Thread Nishikant Kapoor
CREATE TABLE t ( id TINYINT, title VARCHAR(10) ); INSERT INTO t (id, title) VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'), (4, 'ddd'), (5, 'eee'); (a) DO @sn := 0; SELECT @sn:[EMAIL PROTECTED] sn, id, title FROM t GROUP BY id ORDER BY id desc; | sn

Re: Changing the location of my.ini and the order option files are read

2008-10-27 Thread Moon's Father
ogram > > files(x86)\mysql\my.ini\"" > > > > net start mysql > > > > Regards, > > Armin. > > > > > > 2008/10/6 Varuna Seneviratna <[EMAIL PROTECTED]>: > > > I added a line to the [mysqld) group > >

Re: order of items in a WHERE...IN clause

2008-10-24 Thread Moon's Father
See the usage of the function named field. On Mon, Jul 28, 2008 at 8:15 PM, Mr. Shawn H. Corey <[EMAIL PROTECTED]>wrote: > On Mon, 2008-07-28 at 07:32 -0400, Gary Josack wrote: > > Andrew Martin wrote: > > > Hello, > > > > > > Is it permissible to order

Re: ORDER BY Help

2008-10-24 Thread Tompkins Neil
Hi Basically from the query below, it would only return one product like RedLight. But I need to return a list of all products, ordered by a SELECT ProductID, ProductName, AVG(ProductScore * Quantity) AS a FROM Products GROUP BY ProductID ORDER BY a DESC On Fri, Oct 24, 2008 at 2:53 PM

Re: ORDER BY Help

2008-10-24 Thread Olexandr Melnyk
Light >>> 0.055 >>> %2008-11-11160 Green Light >>> 0.065 >>> % 2008-11-12160 Green Light >>> 0.115 >>> Is this possib

Re: ORDER BY Help

2008-10-24 Thread Tompkins Neil
gt;> 0.055 >> %2008-11-11160 Green Light >> 0.065 >> %2008-11-12160 Green Light >> 0.115 >> Is this possible ? >> On Fri, Oc

Re: ORDER BY Help

2008-10-24 Thread Olexandr Melnyk
ECTED]>wrote: > >> SELECT ProductID, >> ProductName, >> AVG(ProductScore * Quantity) AS a >> FROM Products >> GROUP BY ProductID >> ORDER BY a DESC >> >> 2008/10/24, Tompkins Neil <[EMAIL PROTECTED]>: >>> >>> Following on

Re: ORDER BY Help

2008-10-24 Thread Tompkins Neil
wrote: > SELECT ProductID, > ProductName, > AVG(ProductScore * Quantity) AS a > FROM Products > GROUP BY ProductID > ORDER BY a DESC > > 2008/10/24, Tompkins Neil <[EMAIL PROTECTED]>: > >> Following on from my email below I now need help with the following

Re: ORDER BY Help

2008-10-24 Thread Olexandr Melnyk
SELECT ProductID, ProductName, AVG(ProductScore * Quantity) AS a FROM Products GROUP BY ProductID ORDER BY a DESC 2008/10/24, Tompkins Neil <[EMAIL PROTECTED]>: > > Following on from my email below I now need help with the following > problem. Here is a list of my sampl

  1   2   3   4   5   6   7   8   9   10   >