0

i have this database

id user_id auction_id no_of_bids bid_value timestamp 110 236 435 3 6 2015-11-10 12:40:21 111 238 435 4 6 2015-11-10 12:46:33 

i want to re arrange the order of these records, for example in the current situation, i want 238 to come before 236, is there a query to execute the said operation? i know about changing column orders, but i believe records can not be re arranged like that. is there a way or query where i can re arrange the records and let 238 come before 236, or, be at the top of records?

2
  • a simple select query, select * from psf_bidomatic Commented Nov 10, 2015 at 13:09
  • well that's pretty obvious, i was looking for a query to perform this action in my code. PHP code. Commented Nov 10, 2015 at 13:11

1 Answer 1

1

You can use order by:

select t.* from t order by (t.user_id = 238) desc; 

This will put 238 first.

Sign up to request clarification or add additional context in comments.

1 Comment

(or perhaps just order by user_id desc - the question isn't really clear enough. Anyway @FaizanShah, either way, it's pretty obvious too, isn't it ;-) )

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.