Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IN () and ORDER by IN ()

Status
Not open for further replies.

miguel11

Programmer
May 24, 2001
8
PE
is it possible order by IN, how can I do it? each time I try this way, the order

is ascendent and ordered by items_id, I want It keeps the items_id_list order,
any idea?

"SELECT * FROM items WHERE items_id IN (" & items_ID_List & ") ORDER BY IN (" &

items_ID_List & ")"


thanks in advance

Miguel
 
Can you write a function to generate a sort sequence number, and then order by the sort sequence number?

create function items_id_list_order
{
logic to generate sort order here
}

SELECT *,items_id_list_order(items_id) as sort_order FROM items
WHERE items_id IN (" & items_ID_List & ")
ORDER BY sort_order
 
thanks for your idea and your time
working on it!! right now
thanks
Miguel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top