Page 1 of 1
strange problem with sort!
Posted: Thu Jan 15, 2004 8:27 am
by pelegk2
i am doing this :
Code: Select all
SELECT * from clients order by client_name asc
and for some reason i dont get the result sorted!!!!!
why is that?thanks in advance
peleg
Posted: Thu Jan 15, 2004 8:54 am
by Dr Evil
Are you sure you don't have spaces before some of your names or other hidden characters ?
Dr Evil
Posted: Thu Jan 15, 2004 9:08 am
by JayBird
what data type is the client_name field?
Mark
Posted: Sun Jan 18, 2004 1:27 am
by pelegk2
its varcahr(30) and ichecked no spaces!
Posted: Sun Jan 18, 2004 2:03 am
by kettle_drum
Everything looks fine unless your mis-spelling the field or table name. Just try playing with it a bit:
SELECT * FROM clients ORDER BY client_name ASC
Posted: Sun Jan 18, 2004 2:06 am
by pelegk2
maybe the problem its hebrew letters?
right to left language?
but still strange in other places works just find
Posted: Sun Jan 18, 2004 2:14 am
by markl999
ASC is the default order anyway, so you don't need to specify it. As a test, if you sort by DESC instead, are the results in a different order than if you omit the order? (just to prove it's at least doing some sort of ordering

)
Posted: Sun Jan 18, 2004 2:19 am
by pelegk2
nope it gives not the correct order opposite
but an oposite order to the regular order i recive at the moment
Posted: Sun Jan 18, 2004 2:33 am
by markl999
Must be down to the hebrew characters then, you could try starting mysql with the --default-character-set=hebrew option to see if it makes any difference, though i'm not sure if that is your default character set or just for this particular instance, but worth a go as a test.
http://www.mysql.com/doc/en/Character_sets.html is worth a read too.
Posted: Sun Jan 18, 2004 2:39 am
by pelegk2
where execlly do i do :
"default-character-set=hebrew "
in which ini file do i define it?
Posted: Sun Jan 18, 2004 2:40 am
by markl999
Windows or *nix ?
Posted: Sun Jan 18, 2004 2:48 am
by pelegk2
windows
Posted: Sun Jan 18, 2004 2:49 am
by pelegk2
by the way how can i check for each table whats it "character-set"
set to?
Posted: Sun Jan 18, 2004 3:06 am
by markl999
You can put :
set-variable=default-character-set=hebrew
in my.ini (which i think is in c:\windows) then restart mysql.
I'm not sure how (or even if) you can set a character set per table.
Posted: Sun Jan 18, 2004 3:14 am
by pelegk2
well i did it but no change i still see the default latin1?