I have a table which stores user login ID. Now i want to display information so tat the logged in user's ID should be on top and other should be at the bottom. For exapmle if the user ID is 3 then all the records with 3 should appear first and other records should follow the list.. How do I do this?
mechanical_meat
170k2525 gold badges237237 silver badges231231 bronze badges
Add a comment |
1 Answer 1
... ORDER BY CASE WHEN user_id = 3 THEN 1 ELSE 2 END ... answered Apr 24, 2011 at 15:15
mechanical_meat
170k2525 gold badges237237 silver badges231231 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
- The Overflow Blog
-
-
- Featured on Meta
-
-
-
Related
Hot Network Questions
- Mirror in both directions in Inkscape
- Whose responsibility is it to destroy a C++20 coroutine that throws from its initial suspend?
- How to automatically refresh or reload Import CSV node data?
- Induced Topological Vector Space Structure?
- Replacing Exterior Outlet/Receptacle Covers
- Regular pentagram inscribed in a parabola
- Analog story - Human music contains coded alien message
- Effective resistance of a finite grid of resistor
- What is this infrared receiver part on Philips 55PUK6400 TV module "715G7074-R01-000-004Y"
- Making the most out of rawhide armour
- When was the last time U.S. Congress overrode a president's veto?
- Ioniq 6 "Oil Fortifier"
- Trivialising homogeneous vector bundles over a homogeneous space
- A Sequence of Words
- How to recreate a DuPont scheme
- Reacting calcium with acetic acid - safe to conduct in classroom environment?
- Producing the sums outside of the 3x3 Magic Square
- What do "spelling pronunciation" and "~" mean in Wiktionary?
- Adding comments to cited paper
- Descriptive Grid
- Origin of the Popular Distinction Between Morals and Ethics
- Proving an order relation between two concrete real numbers (Lean)
- How to resize ext4 without adding more inodes?
- Looking for a book for teenagers involving heaven and hell
lang-sql