Weiss Posted September 14, 2017 Share Posted September 14, 2017 hi. i have an array with 8 id numbers (e.g. [4234, 3241, 2313, ....]; i have an sql table with those id numbers among others.. i want to make a query with fetch the data, i can do that with using IN (4234,3241....) but the problem is that i get the data when its oredered by numbers from small to big.. i want it oredered exactly as the array meanning the first row should be with id = 4324, second with 3241 etc... how can i do that? thanx Link to comment Share on other sites More sharing options...
niche Posted September 14, 2017 Share Posted September 14, 2017 (edited) create a variable for everything inside the parens. Do you need procedural or OO code? Edited September 14, 2017 by niche Link to comment Share on other sites More sharing options...
justsomeguy Posted September 14, 2017 Share Posted September 14, 2017 Use a separate field in the table to specify the sort order, and when you insert the data make the sort order field whatever order you want to retrieve the data. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now