Retrieve Result order by specific id

select * from table order by case when web_id= ‘4’ then 1 when web_id=’3′ then 2 when web_id=’6′ then 3 when web_id=’7′ then 4 when web_id=’2′ then 5 end, web_id

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s