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!

sql alternate result set

Status
Not open for further replies.

stevebooks

Programmer
Jan 4, 2007
2
Hello,

Was wondering if anyone knew how to do a sql select that will alternate a result set.

For example,

I have a table called account and in account I have two different seller types 'I' and 'D'. After I run a sql query I want an 'I' record to show up and then a 'D' record and then 'I', etc....

Thanks!
 
not easily

i can think of one way to do it which involves two temporary tables with auto_increments and a UNION query

what's this for?

r937.com | rudy.ca
 
i would use php or some other application and still it wouldn't be all that simple.
 
Yea, I am doing a website and using cgi/perl. I wanted to do one sql select statement, but I ended up doing two sql statements, and then via code I re-organized the results.


Thanks for the help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top