Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to group search by criteria in one query?

Status
Not open for further replies.

viannone

Programmer
Apr 4, 2003
1
US
Is it possible to write a single query in mySQL that would do such a thing:

Select all people with name1, then select all people with name2, then all people with name3

And it all should be in one query so after running it we would get a result like:

ID Name

1. Pete
3. Pete

2. Ann
4. Ann
5. Ann

6. Sam
7. Sam

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top