Computing.Net > Forums > Database > my sql problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

my sql problem

Reply to Message Icon

Name: bhuwan81
Date: January 12, 2008 at 23:03:28 Pacific
OS: winxp sp2
CPU/Ram: 512
Product: wipro
Comment:

can I have certain row of a table first in my "select * from any table".
eg. suppose I have a table name 'student' with fields id and name.
ids are 1,2,3,4,5 and names are a,b,c,d,e.
I want to get result as the name = b should be in first row of the result always number of ids and names may increase.



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: January 13, 2008 at 09:49:49 Pacific
Reply:

Your "question" doesn't make sense. Please rephrase your question.


0

Response Number 2
Name: User123456789
Date: February 3, 2008 at 06:35:13 Pacific
Reply:

I'll assume you want this:

select * from any table order by ID_COLUMN asc;

Hi there.


0

Response Number 3
Name: jon_k
Date: March 27, 2008 at 05:02:28 Pacific
Reply:

Apologies if this is way off the mark, but I think what you want can be achieved with:

SELECT * FROM student ORDER BY IF(name like 'b',0,name)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: my sql problem

sql syntax problem www.computing.net/answers/dbase/sql-syntax-problem/291.html

Issues with Quest SQL navigator www.computing.net/answers/dbase/issues-with-quest-sql-navigator/533.html

SQL Question about DISTINCT www.computing.net/answers/dbase/sql-question-about-distinct/289.html