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
I wrote this query, making use of MySQL s permissive 'GROUP BY', for to keep only one record with a given value of 'Email', quite indifferent which record is kept: select REPLACE(eMail, '- ', '') AS Email, IFNULL(foreignKey, '') AS "Foreign Key", "Full Name", "List Membership" from PHPLIST2 AS

Chinese sorting and filtering on an table with charset utf-8

2011-03-07 Thread Tierlieb
hat I like about UTF-8. But sorting does not work. And, related to that, comparisons neither. I'm getting the hopefully silly notion that there is no collation for CHARSET=UTF-8 that could sort according to the rules of GB2312 (which, if it was true, would probably an interesting story to expla

Re: sorting numbers as spelled

2010-07-20 Thread mos
Robert, The titles should be sorted as they are stored. The "12" should come before the other titles, just as they do with other online movie databases. See http://www.imdb.com/find?s=all&q=angry The only problem would be of course if someone searches on "Twelve", it should also return movi

sorting numbers as spelled

2010-07-20 Thread Ramsey, Robert L
Say I have the following data: +---+ | title | +---+ | ...And justice fo

Re: Adhoc sorting requirement

2009-07-05 Thread Ravindra Harige
>> >> -Original Message- >> From: Nathan Sullivan >> Sent: Thursday, July 02, 2009 1:07 PM >> To: 'Ravindra Harige'; mysql@lists.mysql.com >> Subject: RE: Adhoc sorting requirement >> >> Ravindra, >> >> Maybe something like th

Re: Adhoc sorting requirement

2009-07-02 Thread Ravindra Harige
p, interval 2 day))) then 3 > else 4 > end, date_field_3, date_field_2, date_field_1; > > -Original Message- > From: Nathan Sullivan > Sent: Thursday, July 02, 2009 1:07 PM > To: 'Ravindra Harige'; mysql@lists.mysql.com > Subject: RE: Adhoc sorting requirement &

RE: Adhoc sorting requirement

2009-07-02 Thread Nathan Sullivan
27;; mysql@lists.mysql.com Subject: RE: Adhoc sorting requirement Ravindra, Maybe something like this? order by case when (date_field_1 between date(current_timestamp) and date(date_add(current_timestamp, interval 2 day))) then 1 when (date_field_2 between date(current_timestamp) and dat

RE: Adhoc sorting requirement

2009-07-02 Thread Nathan Sullivan
, 2009 12:18 PM To: mysql@lists.mysql.com Subject: Adhoc sorting requirement Hi, I have a very ad hoc sorting requirement and would like to know how this can be achieved. The requirement is as follows: I have a table (of say 100 records) with 3 DATE fields: date_field_1 , date_field_2 , date_field_3 I

Adhoc sorting requirement

2009-07-02 Thread Ravindra Harige
Hi, I have a very ad hoc sorting requirement and would like to know how this can be achieved. The requirement is as follows: I have a table (of say 100 records) with 3 DATE fields: date_field_1 , date_field_2 , date_field_3 I have a date range, for eg. from (today) to (today+2) and Each one of

UTF-8 sorting

2008-03-24 Thread C K
Hi, I am getting a problem while making a sort on any column having character set as UTF-8. The soring from a view or a query through ODBC is very slow. I have data in us-english and marathi languages at a time. Sorting is proper but very time consuming! What to do to solve this problem? Your

Re: Unicode sorting and binary comparison, please!

2008-03-06 Thread Yves Goergen
On 06.03.2008 15:15 CE(S)T, Paul DuBois wrote: Here's some advice from Alexander Barkov: You might be able to use a particular collation to achieve what you want. For example, latin1_general_ci. You can take a look at its collation chart here: http://www.collation-charts.org/mysql60/mysql604.lat

Re: Unicode sorting and binary comparison, please!

2008-03-03 Thread Yves Goergen
what you want basically, and I think there might possibly be a need for this. That would effectively be what I originally wanted. Use Unicode for sorting things, but do not use Unicode for comparing with the = operator. LIKE may work with Unicode, as its name already implies a level of fuzzyness. I&#

Re: Unicode sorting and binary comparison, please!

2008-03-03 Thread Anders Karlsson
agree with you, I am swedish by all means. But using a language collation where these characters don't exist just doesn't cut it. UNICODE collation determines not only sorting but also equality (i.e. "é" = "e" etc). Right or wrong, well I think that however you tur

RE: Unicode sorting and binary comparison, please!

2008-03-03 Thread Lopez David E
yves when creating a varchar field in table creation, use the binary. that way, selection is exact. always. david -Original Message- From: Yves Goergen [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2008 1:44 PM To: Anders Karlsson Cc: MySQL Subject: Re: Unicode sorting and binary

Re: Unicode sorting and binary comparison, please!

2008-03-03 Thread Yves Goergen
On 03.03.2008 10:27 CE(S)T, Anders Karlsson wrote: > [a lot about why sorting unicode is complicated] If you want to accknowledge exact matching, and say any character, accented / unlauted etc, is different from any other character, specifiy a binary comparison: SELECT * FROM phonebook WH

Re: Unicode sorting and binary comparison, please!

2008-03-03 Thread Anders Karlsson
ike more case sensitive collations myself. Case sensitiveness is also something that is different for different characters in different languages. Hope this helps a bit /Karlsson Yves Goergen wrote: Hello, I've just read through the MySQL documentation about Unicode support, collations an

Unicode sorting and binary comparison, please!

2008-03-02 Thread Yves Goergen
Hello, I've just read through the MySQL documentation about Unicode support, collations and how it affects sorting and comparison of strings. And I find it horrible, at least. I feel like I'm back in the MySQL 3.x days where I used UTF-8 in my application and MySQL treated it b

Re: Date sorting problem with Date_Format?

2008-02-08 Thread mikesz
Hello mysql list, As is very often the case, five minutes after I posted this, I found the problem or solution, not sure it was the "problem" as I am not convinced that mysql ought to get confused so easily. I changed DATE_FORMAT( `Messages`.`Date`, '%D %M %Y' ) AS Date, DATE_FORMAT( `Messages`.

Date sorting problem with Date_Format?

2008-02-08 Thread mikesz
Hello mysql, I have a PHP script that is running the following query: SELECT `Messages`.`ID`, `Messages`.`Sender`, `Messages`.`Subject`, DATE_FORMAT( `Messages`.`Date`, '%D %M %Y' ) AS Date, LEFT(`Messages`.`Text`, 200 ) AS Preview, `Messages`.`New`, `Profiles`.`NickName`, `Profiles`.`RealName`

Re: Fast relevance sorting of full text search results

2008-01-09 Thread Sebastian Mendel
Urms schrieb: > I'm using pretty standard approach to sorting search results by relevancy: > > SELECT DISTINCT product_name, > MATCH (keywords) AGAINST ('CONSOLIDATED* 16* bearing*' IN BOOLEAN MODE) AS > rate > FROM _TT > WHERE MATCH ( keywords ) AGAINST (&#x

Re: Fast relevance sorting of full text search results

2008-01-06 Thread Shawn Green
Urms wrote: I'm using pretty standard approach to sorting search results by relevancy: SELECT DISTINCT product_name, MATCH (keywords) AGAINST ('CONSOLIDATED* 16* bearing*' IN BOOLEAN MODE) AS rate FROM _TT WHERE MATCH ( keywords ) AGAINST ('CONSOLIDATED* 16* bearing*&#x

Re: Sorting Tables

2008-01-02 Thread Victor Subervi
to be random unless you > > > specify an Order by clause. The only thing I can think of is to > create a > > > new table, maybe temporary or Memory table and copy the data into it > > > already sorted. > > > > > > drop table if exists newtable; > &g

Re: Sorting Tables

2008-01-02 Thread Baron Schwartz
le if exists newtable; > > create newtable like oldtable; > > insert into newtable select * from oldtable order by col1, col2; > > > > Now you should be able to > > > > Select * from NewTable; > > > > without sorting (if you don't update it). The order sh

Re: Sorting Tables

2008-01-02 Thread Victor Subervi
a into it > already sorted. > > drop table if exists newtable; > create newtable like oldtable; > insert into newtable select * from oldtable order by col1, col2; > > Now you should be able to > > Select * from NewTable; > > without sorting (if you don't update it). Th

Fast relevance sorting of full text search results

2008-01-01 Thread Urms
I'm using pretty standard approach to sorting search results by relevancy: SELECT DISTINCT product_name, MATCH (keywords) AGAINST ('CONSOLIDATED* 16* bearing*' IN BOOLEAN MODE) AS rate FROM _TT WHERE MATCH ( keywords ) AGAINST ('CONSOLIDATED* 16* bearing*' IN BOOLEA

Re: Sorting Tables

2007-12-31 Thread mos
from oldtable order by col1, col2; Now you should be able to Select * from NewTable; without sorting (if you don't update it). The order should be by col1,col2. (No guarantee) If you want to sort it in order to speed it up, then run an Optimize on the table. Mike -- MySQL Gener

Re: greek collation & sorting

2007-06-27 Thread tasos
Hello sir and thanks for replying. I'm have tried all greek collations.The fact is that when sorting i see first the latin characters(sorted) and then the greek ones(again sorted).I want to have a choice.I mean i want to see first the A latin and then the greek A.Then B latin and B greek e

Re: greek collation & sorting

2007-06-27 Thread Martin Gainty
message without making a copy. Thank you. - Original Message - From: "tasos" <[EMAIL PROTECTED]> To: Sent: Wednesday, June 27, 2007 1:16 PM Subject: greek collation & sorting Hello people.I would like to ask the following.Using greek character set and collation i pe

greek collation & sorting

2007-06-27 Thread tasos
Hello people.I would like to ask the following.Using greek character set and collation i perform a select-order by.But i get first the latin characters and then the greek ones.Can i show first the greek ones and then the latin? Thank you in advance! ps:moreover i would like to sort them in pairs

Re: Sorting Question

2007-06-21 Thread Perrin Harkins
On 6/21/07, CA Lists <[EMAIL PROTECTED]> wrote: Note that "uid" 12880 is now AFTER 12878, which is its parent. Sounds like you want ORDER BY COALESCE(parent, uid) DESC. - Perrin -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql

Sorting Question

2007-06-21 Thread CA Lists
Does anyone have a clever way that I can sort on two fields? Let me explain...I need the sort to be by the "uid" field (see below), but also have the "parent" field taken into consideration: Here's a sample of what I get now: +---+---++ | uid | duplicate | parent | +---+

Re: Sorting by a list of possible results in a column....

2007-06-05 Thread Peter Brawley
Mike I have a query that selects a list of results, ordering them by the status field. However, I want to further sort that by the type of status, that is: Undefined Ready for Review Top Priority Priority Completed ORDER BY FIELD( columnname, 'Undefined', 'Ready for Review', ... ) PB Mik

RE: Sorting by a list of possible results in a column....

2007-06-05 Thread Geoffroy Cogniaux
status Bye Geoffroy -Message d'origine- De : Mike Morton [mailto:[EMAIL PROTECTED] Envoyé : mardi 5 juin 2007 23:26 À : mysql@lists.mysql.com Objet : Sorting by a list of possible results in a column I am sure that this has been asked - but in searching through google and lists for

RE: Sorting by a list of possible results in a column....

2007-06-05 Thread Jay Blanchard
[snip] I have a query that selects a list of results, ordering them by the status field. However, I want to further sort that by the type of status, that is: Undefined Ready for Review Top Priority Priority Completed Etc... Every sort that I try, of course, sorts alphabetically. Is there a way

Sorting by a list of possible results in a column....

2007-06-05 Thread Mike Morton
I am sure that this has been asked - but in searching through google and lists for about an hour - hopefully someone will indulge me a repeat question here. I have a query that selects a list of results, ordering them by the status field. However, I want to further sort that by the type of status

Re: Tricky Sorting

2007-04-02 Thread Shannon Appelcline
I think you're right and using an IF is ultimately the right answer. However just substituting issuenum for issuedate doesn't do the right thing. Looking at my sorting a bit more analytically I think that what I need to do is, WHEN there isn't a month number, THEN substitute the

Re: Tricky Sorting

2007-04-02 Thread Brent Baisley
edate, issuenum,... FROM tablename ORDER BY sortfield. I don't know your field names and table structure, so you'll need to change the names. - Original Message - From: "Shannon Appelcline" <[EMAIL PROTECTED]> To: Sent: Saturday, March 31, 2007 1:32 AM Subjec

Tricky Sorting

2007-03-30 Thread Shannon Appelcline
I'm trying to figure out the best way to do a tricky bit of sorting. I'm pretty sure it's entirely possible with an IFNULL or something, but I always feel like I hit a barrier when I get to a certain level of complexity in my MYSQL. In any case, I have some magazines, each of whic

Re: Sorting Problem

2007-03-26 Thread Ales Zoulek
26, 2007 10:06 AM *To:* [EMAIL PROTECTED] *Cc:* Micah Stevens; mysql@lists.mysql.com *Subject:* Re: Sorting Problem Try: select * from business_names left join business_entries using (bus_id) left join business_categories using (bcat_id) where business_categories.bcat_id=17 order by business_nam

RE: Sorting Problem

2007-03-26 Thread Sid Price
PROTECTED] Cc: Micah Stevens; mysql@lists.mysql.com Subject: Re: Sorting Problem Try: select * from business_names left join business_entries using (bus_id) left join business_categories using (bcat_id) where business_categories.bcat_id=17 order by business_names.organisation You must have

Re: Sorting Problem

2007-03-26 Thread Ales Zoulek
Micah Stevens [mailto:[EMAIL PROTECTED] Sent: Monday, March 26, 2007 1:10 AM To: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Sorting Problem The query using JOIN syntax (you can read about this in the documentation) describes the interelationship between the three tables you described, in th

RE: Sorting Problem

2007-03-26 Thread Sid Price
@lists.mysql.com Subject: Re: Sorting Problem The query using JOIN syntax (you can read about this in the documentation) describes the interelationship between the three tables you described, in this way you can select information based on a WHERE clause as it relates to the category table, while

Re: Sorting Problem

2007-03-25 Thread Micah Stevens
http://www.softtools.com -Original Message- From: Micah Stevens [mailto:[EMAIL PROTECTED] Sent: Sunday, March 25, 2007 9:23 PM To: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Sorting Problem This doesn't work? SELECT businesses.name from businesses left join links using (businessID)

RE: Sorting Problem

2007-03-25 Thread Sid Price
evens [mailto:[EMAIL PROTECTED] Sent: Sunday, March 25, 2007 9:23 PM To: [EMAIL PROTECTED]; mysql@lists.mysql.com Subject: Re: Sorting Problem This doesn't work? SELECT businesses.name from businesses left join links using (businessID) left join categories using (categoryID) where cat

Re: Sorting Problem

2007-03-25 Thread Micah Stevens
data by company name, The "entries" table holds the business ID and category ID so sorting the entries that match the category doesn't help. Do I need to create a temporary table to hold the business names/addresses in a category so that I can then sort it?

Re: Not Sorting Correctly

2007-03-23 Thread Francesco Riosa
ot the same. What field types are you using? Mine are as follows: RoomNo VarChar(10) LastName VarChar(25) FirstName VarChar(25) the values that I put into Room No are "1","2","3", etc. I'm not storing "001","002

Re: Not Sorting Correctly

2007-03-23 Thread Rolando Edwards
,firstname,lastname from test.names) A order by text,lastname,firstname; - Original Message - From: "Jesse" <[EMAIL PROTECTED]> To: "Zhaowei" <[EMAIL PROTECTED]>, mysql@lists.mysql.com Sent: Friday, March 23, 2007 11:23:21 AM (GMT-0500) Auto-Detected Subject

Re: Not Sorting Correctly

2007-03-23 Thread Jesse
not storing "001","002","003", etc in there. Jesse - Original Message - From: "Zhaowei" <[EMAIL PROTECTED]> To: "Jesse" <[EMAIL PROTECTED]>; Sent: Friday, March 23, 2007 5:03 AM Subject: Re: Not Sorting Correctly Hi

Re: Not Sorting Correctly

2007-03-23 Thread Jesse
make an alias for the field you want as sort key and use that. you don't need to do the calculation twice. I would not be surprised if the sort started to behave. Didn't help. The results are exactly the same. Jesse -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Re: Not Sorting Correctly

2007-03-23 Thread Zhaowei
From: "Ales Zoulek" <[EMAIL PROTECTED]> To: "Jesse" <[EMAIL PROTECTED]> Cc: "MySQL List" Sent: Monday, March 19, 2007 9:06 PM Subject: Re: Not Sorting Correctly > pls, post result of: > > SELECT RIGHT(CONCAT('000,RoomNo),3),LastName,FirstName FRO

Re: Not Sorting Correctly

2007-03-22 Thread Michael Dykman
inal Message - From: "Ales Zoulek" <[EMAIL PROTECTED]> To: "Jesse" <[EMAIL PROTECTED]> Cc: "MySQL List" Sent: Monday, March 19, 2007 9:06 PM Subject: Re: Not Sorting Correctly > pls, post result of: > > SELECT RIGHT(CONCAT('000,RoomNo),3),Last

Re: Not Sorting Correctly

2007-03-22 Thread Jesse
L PROTECTED]> Cc: "MySQL List" Sent: Monday, March 19, 2007 9:06 PM Subject: Re: Not Sorting Correctly pls, post result of: SELECT RIGHT(CONCAT('000,RoomNo),3),LastName,FirstName FROM Ales On 3/19/07, Jesse <[EMAIL PROTECTED]> wrote: I have an app that I've co

Re: Not Sorting Correctly

2007-03-19 Thread Ales Zoulek
pls, post result of: SELECT RIGHT(CONCAT('000,RoomNo),3),LastName,FirstName FROM Ales On 3/19/07, Jesse <[EMAIL PROTECTED]> wrote: I have an app that I've converted to MySQL from MS SQL. I used to use the following to force a Alpha field to sort as if it were numeric (I know, perhaps it

Not Sorting Correctly

2007-03-19 Thread Jesse
I have an app that I've converted to MySQL from MS SQL. I used to use the following to force a Alpha field to sort as if it were numeric (I know, perhaps it is better if I made the field numeric to begin with, but it's not, and I don't remember why, but that's not the question here): ORDER BY

Re: Numeric sorting within a string

2007-02-16 Thread Chris White
Brian Mansell wrote: This is totally possible... Chris say your table is test, and the column is test_col.. use the following, and if the number is always at the end.. and always has a space in front of it this will work: SELECT test_col, SUBSTRING_INDEX(test_col, '', 1) as test_col_str, SUBSTR

Re: Numeric sorting within a string

2007-02-15 Thread Brian Mansell
This is totally possible... Chris say your table is test, and the column is test_col.. use the following, and if the number is always at the end.. and always has a space in front of it this will work: SELECT test_col, SUBSTRING_INDEX(test_col, '', 1) as test_col_str, SUBSTRING_INDEX(test_col, '

Numeric sorting within a string

2007-02-15 Thread Chris White
I'm wondering if there is a way to do a numeric sort when the number exists in a string. More clearly, take for example: Radius 1200 Radius 1500 Radius 1800 Radius 300 Radius 600 Radius 900 Being that character wise 1 is before 3, I'm wondering if there's a way through the database to achieve

UTF-8 sorting problem

2007-01-12 Thread Joakim Lemström
Hello I've got a problem,, I've tried to search the archive for this list with no luck. Maybe it's because Unicode problems isn't that rare... Anyway .. Here is my problem. Sorting on a VARCHAR collate utf8_swedish_ci (table with default charset utf8).. As ma

Re: Sorting MySQL queries

2006-11-06 Thread Christian Hammers
On 2006-11-06 Dotan Cohen wrote: > > Make a second column that only contains > >ALTER TABLE table ADD cooked_subject; > >UPDATE table SET cooked_subject = ereg_replace('^(a|the) ', '', subject); > >(I don't know how the regular expression function was called exactly but > > you get t

Re: Sorting MySQL queries

2006-11-06 Thread Dotan Cohen
On 06/11/06, Christian Hammers <[EMAIL PROTECTED]> wrote: On 2006-11-06 Dotan Cohen wrote: > I have a list of subjects, such as "Linux", "Open Source", and "the > World Wide Web". The subjects are stored in MySQL and being retrieved > via php. I currently organize them alphabetically with MySQL's

Re: Sorting MySQL queries

2006-11-06 Thread Christian Hammers
On 2006-11-06 Dotan Cohen wrote: > I have a list of subjects, such as "Linux", "Open Source", and "the > World Wide Web". The subjects are stored in MySQL and being retrieved > via php. I currently organize them alphabetically with MySQL's "ORDER > BY ASC" argument, however, if there is a precedi

Sorting MySQL queries

2006-11-06 Thread Dotan Cohen
I have a list of subjects, such as "Linux", "Open Source", and "the World Wide Web". The subjects are stored in MySQL and being retrieved via php. I currently organize them alphabetically with MySQL's "ORDER BY ASC" argument, however, if there is a preceding "the " or "a " then that is considered

Re: Sorting numerically within a varchar

2006-10-05 Thread mark addison
As I've often thought it would be very useful if MySQL regexp support included being able to pull out the substring matched (and do regexp substitutions). Although that could just be my perl sensibilities ;-) mark On Tue, 2006-10-03 at 17:27 -0500, mos wrote: > James, > That wasn't to

Re: Sorting numerically within a varchar

2006-10-03 Thread mos
James, That wasn't too easy to figure out. But this will work: select * from Table1 order by substring_index(Music_Title,' ',2),-- Extracts first 2 words 0+Substring_Index(Substring_index(Music_Title,'-',1),' ',-2), -- Extracts the number substring_index(Music_Title,' ',-1) --

Re: Sorting numerically within a varchar

2006-10-03 Thread Dan Buettner
that could conceivably be done in SQL too. Here's a sample of one way to do it, using substrings based on ' ' (space) characters, casting the result to an unsigned int, then sorting on that column. SELECT dataline, CAST( SUBSTRING_INDEX( SUBSTRING_INDEX(dataline, ' ', 3), &#

Sorting numerically within a varchar

2006-10-03 Thread James Eaton
If I have the following strings in a varchar column: Piano Sonata 1 - Brendel Piano Sonata 10 - Brendel Piano Sonata 11 - Brendel Piano Sonata 12 - Brendel Piano Sonata 13 - Brendel Piano Sonata 14 - Brendel Piano Sonata 15 - Brendel Piano Sonata 16 - Brendel Piano Sonata 17 - Brendel Piano Sonat

RE: sorting datafile for "load data infile"

2006-08-18 Thread George Law
idth char fields. So, I am eager to see if this sorting idea helps any. -- George >>>-Original Message- >>>From: Dan Buettner [mailto:[EMAIL PROTECTED] >>>Sent: Friday, August 18, 2006 3:53 PM >>>To: George Law >>>Cc: MYSQL General List &

Re: sorting datafile for "load data infile"

2006-08-18 Thread Dan Buettner
process the inserts with the sorted data. >>>-Original Message- >>>From: Dan Buettner [mailto:[EMAIL PROTECTED] >>>Sent: Friday, August 18, 2006 1:40 PM >>>To: George Law >>>Cc: MYSQL General List >>>Subject: Re: sorting datafile for "load data

RE: sorting datafile for "load data infile"

2006-08-18 Thread George Law
r [mailto:[EMAIL PROTECTED] >>>Sent: Friday, August 18, 2006 1:40 PM >>>To: George Law >>>Cc: MYSQL General List >>>Subject: Re: sorting datafile for "load data infile" >>> >>>George, I've not heard of that technique - "sorting

Re: sorting datafile for "load data infile"

2006-08-18 Thread Dan Buettner
George, I've not heard of that technique - "sorting so that mysql doesn't have to jump around as much". What I am aware of, and what can make a difference, is disabling indexes prior to starting the load. Your load goes quite a bit faster, in general, but then there is so

sorting datafile for "load data infile"

2006-08-18 Thread George Law
Hello All, An ex-coworker of my recently sent over a link to a mysql article about speeding up mass imports. unfortunately I deleted the email before I had time to actually digest it and now I am wondering if it could help with my imports. The article suggested sorting the data ahead of time to

Re: sorting with php/mysql

2006-05-02 Thread Peter Brawley
Ross, This is my database. Nope, it's a table, not a database. ..I will use the item_id for the order but what if I want to change item_id 3 to item id 1? A primary key shouldn't be edited, and the literal value of an auto_increment column oughtn't to be relevant. If you really need a settabl

sorting with php/mysql

2006-05-02 Thread ross
This is my database...I will use the item_id for the order but what if I want to change item_id 3 to item id 1? How can I push all the items down one place? How can I delete any gaps when items are deleted. Say I delete item 2 how can I delted the gap and 'promote item_id 3 to item_id 2 CREAT

Re: Sorting with NULL

2006-01-09 Thread Michael Stassen
sing FIELD() in the order by, but the docs say it doesn't like nulls. Is there some other sorting mechanism I could use? Thanks, Marcus "id IS NOT NULL" will return 0 when id is NULL, 1 when id is anything else, so ORDER BY id IS NOT NULL, name should do it. Michael --

Sorting with NULL

2006-01-09 Thread Marcus Bointon
sing FIELD() in the order by, but the docs say it doesn't like nulls. Is there some other sorting mechanism I could use? Thanks, Marcus -- Marcus Bointon Synchromedia Limited: Putting you in the picture [EMAIL PROTECTED] | http://www.synchromedia.co.uk -- MySQL General Mailing List For

Re: Slow sorting

2005-12-20 Thread Felix Geerinckx
On 20/12/2005, Marcus Bointon wrote: > I have a table that contains around 400,000 simple names. It's > displaying a subset of them (perhaps 5,000) them a page at a time in > a web interface, sorted by name, so I have a query like this: > > SELECT * FROM names WHERE account=123 ORDER BY lastname,

RE: Slow sorting

2005-12-20 Thread SciBit MySQL Team
most as big as the original table. So instead of simply loading and sorting through one file, MySQL now has to do it with two equally big files. Dare I suggest the following: 1. Remove your name and surname indexes. 2. Ensure you have an index on the account column. 3. Insert a new composite column in

RE: Slow sorting

2005-12-20 Thread Logan, David (SST - Adelaide)
ECTED] Sent: Tuesday, 20 December 2005 9:55 PM To: mysql@lists.mysql.com Subject: Slow sorting I have a table that contains around 400,000 simple names. It's displaying a subset of them (perhaps 5,000) them a page at a time in a web interface, sorted by name, so I have a query like thi

Slow sorting

2005-12-20 Thread Marcus Bointon
I have a table that contains around 400,000 simple names. It's displaying a subset of them (perhaps 5,000) them a page at a time in a web interface, sorted by name, so I have a query like this: SELECT * FROM names WHERE account=123 ORDER BY lastname, firstname LIMIT 0,30 That takes 11 sec

Re: How to avoid sorting sorted tables ?

2005-12-19 Thread C.R.Vegelin
last sort_time. I am afraid I have to simulate an IsSorted property myself. Regards, Cor Vegelin - Original Message - From: "James Harvard" <[EMAIL PROTECTED]> To: "C.R.Vegelin" <[EMAIL PROTECTED]> Cc: Sent: Monday, December 19, 2005 10:48 AM Subjec

Re: How to avoid sorting sorted tables ?

2005-12-19 Thread James Harvard
I suppose you could parse out and compare the update_time value from SHOW TABLE STATUS http://dev.mysql.com/doc/refman/4.1/en/show-table-status.html (or maybe there's a simpler way with MySQL 5's new schema database http://dev.mysql.com/doc/refman/5.0/en/information-schema.html ) and compare it

Re: utf8_bin collation sorting incorrectly?

2005-11-08 Thread Eric Herrera
== == Paul DuBois wrote: At 19:05 -0500 11/7/05, Eric Herrera wrote: I'm attempting to sort using utf8_bin and I don't think its sorting properly. I believe I have everything set correctly. I've append

Re: utf8_bin collation sorting incorrectly?

2005-11-08 Thread Paul DuBois
At 19:05 -0500 11/7/05, Eric Herrera wrote: I'm attempting to sort using utf8_bin and I don't think its sorting properly. I believe I have everything set correctly. I've appended all related data. I also have a small perl script below which I used to generate the tests. I may

Re: utf8_bin collation sorting incorrectly?

2005-11-08 Thread Eric Herrera
also.. ascii characters(1-127) sort correctly using utf8_bin Eric Herrera wrote: I'm attempting to sort using utf8_bin and I don't think its sorting properly. I believe I have everything set correctly. I've appended all related data. I also have a small perl script below

utf8_bin collation sorting incorrectly?

2005-11-07 Thread Eric Herrera
I'm attempting to sort using utf8_bin and I don't think its sorting properly. I believe I have everything set correctly. I've appended all related data. I also have a small perl script below which I used to generate the tests. I may be wrong, but I expect this query: select id,

Re: Sorting results ith umlauts in UTF8 tables

2005-09-05 Thread Gleb Paharenko
Hello. Maybe this could help you somehow: http://bugs.mysql.com/bug.php?id=12191 Check that you are running the latest release. Nico Grubert <[EMAIL PROTECTED]> wrote: > Hi there, > > I am running MySQL 4.1 on Linux. > I have some problems sorting records w

Sorting results ith umlauts in UTF8 tables

2005-09-03 Thread Nico Grubert
Hi there, I am running MySQL 4.1 on Linux. I have some problems sorting records with german umlauts. MySQL is configured to have character set "UTF8" as default. I have created a table like this: CREATE TABLE tblmembers ( memberid int(11) NOT NULL auto_increment, lastname varcha

Re: Sorting by relevance? [SOLVED]

2005-05-09 Thread Erik
of first word name not like '% $crit%', # start of non-first word name # alphabetically Some of these are not in your example, I was just guessing... but you get the idea. Each expression in the ORDER BY clause returns 0 (false) or 1 (true). Because 0 is smal

Re: Sorting by relevance?

2005-05-09 Thread Roger Baklund
Erik Bukakis wrote: I just learned a lot stuff at http://dev.mysql.com/doc/mysql/en/sorting-rows.html including sorting by number-to-text, text-to-number, names, specific values, etc. However, the document didn't mention on how to sort by relevance. For instance, someone search for

Re: Sorting by relevance?

2005-05-09 Thread Michael Stassen
;%ang%' | +-+--+ | 1 |1 | +-+--+ 1 row in set (0.06 sec) Rhino wrote: I don't think you are putting this question very well. You are not really asking about sorting, which is accompli

Re: Sorting by relevance?

2005-05-09 Thread Eamon Daly
word. Eamon Daly - Original Message - From: "Erik Bukakis" <[EMAIL PROTECTED]> To: "MySQL Discussion List" Sent: Monday, May 09, 2005 2:10 PM Subject: Sorting by relevance? I just learned a lot stu

Re: Sorting by relevance?

2005-05-09 Thread Rhino
I don't think you are putting this question very well. You are not really asking about sorting, which is accomplished (primarily) via the ORDER BY clause; you are really asking about searching for rows that meet a certain criteria, which is accomplished (primarily) via the WHERE clause. I

Sorting by relevance?

2005-05-09 Thread Erik Bukakis
I just learned a lot stuff at http://dev.mysql.com/doc/mysql/en/sorting-rows.html including sorting by number-to-text, text-to-number, names, specific values, etc. However, the document didn't mention on how to sort by relevance. For instance, someone search for "Ang": COLUMN NA

Sorting norwegian letters

2005-03-14 Thread Baard Ronningen
Hi, I have a problem with how Mysql sorts norwegian letters. I first found (after a lot of digging) that adding default-character-set=danish to my my.conf file will solve the problems I had with à being sorted before à and Ã. Unfortunately that did not solve the issue with 'AA' being placed togethe

Re: sorting doesn't work correctly with UTF-8 data

2005-01-04 Thread Wolfram Kraus
Erol YILDIZ wrote: Hi, I have mysql-4.0.18 installed and entered data with UTF-8 characters. When I use a Select command, mysql doesn't sort the data correctly which starts with native Turkish letters. Is there a way to fix it? MySQL 4.0.x doesn't support UTF-8, you need MySQL 4.1.x (4.1.8 is the

sorting doesn't work correctly with UTF-8 data

2005-01-04 Thread Erol YILDIZ
Hi, I have mysql-4.0.18 installed and entered data with UTF-8 characters. When I use a Select command, mysql doesn't sort the data correctly which starts with native Turkish letters. Is there a way to fix it? Thanks.. -- Erol YILDIZ HEV Schools Kemerkoy http://www.kemerkoy.k12.tr -- MySQL Gene

sorting doesn't work correctly with UTF-8 data

2005-01-03 Thread Erol YILDIZ
Hi, I have mysql-4.0.18 installed and entered data with UTF-8 characters. When I use a Select command, mysql doesn't sort the data correctly which starts with native Turkish letters. Is there a way to fix it? Thanks.. -- Erol YILDIZ HEV Schools Kemerkoy http://www.kemerkoy.k12.tr -- MySQL Gene

Re: ORDER BY sorting

2004-12-13 Thread Bill Easton
PROTECTED]> Subject: ORDER BY sorting Hello, I'm trying to figure out how sort a column alphabetically, but some of the values start with a numerical value. So when I do the ORDER BY column_name all the values starting alphabeticlly are listed first, then the numerical values after that.. can

ORDER BY sorting

2004-12-11 Thread Mike Blezien
Hello, I'm trying to figure out how sort a column alphabetically, but some of the values start with a numerical value. So when I do the ORDER BY column_name all the values starting alphabeticlly are listed first, then the numerical values after that.. can this be done in a single query.. MySQL

  1   2   3   4   >