Hello everyone!

Is there any way to move an entry in a database.

for example if it looks like this:

item_no | size
111 | XS
211 | XL
322 | S

Is there anywat to get 322 to be the first entry?

Best regards

/Emil Hansson
www.sinesub.com

    Ordering is only applicable to result sets, not tables. Specify an order by clause in your select statement.

    select * from products 
    order by case when item_no = 322 then 0 else 1 end
    

    Concepts such as first or last does not have any meaning in a relational database.

      Write a Reply...