FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


SQL: SELECTing order ?





animassacre
For Ex. lets say we have this SQL Query:
Code:
SELECT * FROM table WHERE column in  (26,1,13,32,2)


it returs rows orderd by column -- 1,2,13,26,32
Arrow How can i query the table so the order of the rows will be 26,1,13,32,2 Question
animassacre
after a good sleep i answered the question myself:

SELECT * FROM table WHERE column1 IN (32,34,11) ORDER BY FIELD(column1,32,34,11 )
Related topics
have problem on my sql
SQL Basics
Sql Error: 1017. Missing all the indexes files of phpbb
SQL error notification in my forum
Need Expert help in php-mysql
inverting order
Error trying to display SQL statement in html table
how to create a new user in sql
ORDER BY (SOLVED! Please close!)
Strange SQL cursor problem. Pls do not ignore if can help.
"order by" in sql or sort() in php
Create Function to create SQL dynamically
SQL ERROR [ mysqli ]
Array Update SQL script not working
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.