Page 1 of 1

hmmm... msql query to stick same name?

Posted: Sat May 29, 2004 1:22 am
by kevin7
Assume, i hv this record inside my table

ID Name Sex
----------------------------------
1000 James M
1001 Kevin M
1002 Melissa F
1003 Simon M
1004 Kevin M
1005 Kevin M
1006 Simon M
1007 Kevin M
1008 Simon M
1009 Kevin M

how can i query it from database and display as...

ID Name Sex
----------------------------------
1001 Kevin M
1004 Kevin M
1005 Kevin M
1007 Kevin M
1009 Kevin M
1006 Simon M
1003 Simon M
1008 Simon M
1000 James M
1002 Melissa F


the order is not important...
i only want to show that similar name will stick together..~

yeah~ the thing i want is... stick the name that are same together~

how can i do this? wat is the mysql query for this?
how can i query it from database and display it?
can u show me the code~?

tq

Posted: Sat May 29, 2004 4:32 am
by feyd
SELECT id,name,sex FROM users ORDER BY name

?

Posted: Sat May 29, 2004 9:35 am
by kevin7
hmm.. perhaps i ask a wrong question...

my situation here was kinda complex...
aisk... nvm...

Posted: Sat May 29, 2004 10:09 am
by kettle_drum
Well explain your problem more, feyd has answered the question you seemed to ask.

Posted: Sat May 29, 2004 3:04 pm
by Pyrite
Does he need the code to display the result set for SQL Server? Or did he mean MySQL?

Posted: Sat May 29, 2004 3:09 pm
by tim
well that would be the million dollar question pyrite

:wink: