0

Hello All.

Is there any syntax for getting fields in a column in an alphabetical order in mysql?

See, for example...
I have a two column with "NAME & NUM".
NAME NUM
BHANU 6
KIRAN 3
ADAPA 8
CHANDU 7

I need to get the names in alphabetical order.
There is one syntax : select NAME from tablename orderby NUM;

I don't need this syntax.
Without having these kind of Syntaxes, it should display directly.
Help needy.

5
Contributors
5
Replies
6
Views
8 Years
Discussion Span
Last Post by bhanu1225
0

hi
if you want albhabet name than you should use naa order by name
But i dont know another way

select NAME from tablename order by NAME;

Thanks

0

You could also have them bothlisted alpabetically.

SELECT name, num FROM tablename ORDER BY name, num

That might give you:

+------+-----+
| name | num |
+------+-----+
| Abc  |   1 |
| Abc  |   2 |
| Abc  |   4 |
| Bbc  |   2 |
| Bbc  |   5 |
| Cbc  |   3 |
| Cbc  |   7 |
+------+-----+
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.