hi,
i want to use ORDER BY in my select query but i want to sort the column as like it ... i mean i have some special words in this column i want to sort them:
for example:
the column have this words (read,give,book,job,door) ... i want to sort them like this job,read,door,book.give
how can i do this in select query???
i mean not alphabetically
Loading

Suthish NairPosted Sep 17, 2013, 5:14 AM
Hemant SrivastavaPosted Sep 16, 2013, 1:54 PM
What I am thinking you may add an extra column where you can keep the priority order of the specific elements and then sort the words column by their priorities.For example:
Suppose before sorting you list is: read,give,book,job,door
Not you add extra column 'Priority'
WORD PRIORITY
read 2
give 5
book 4
job 1
door 3
Then run this SQL query,
SELECT Word_Column
FROM table
ORDER BY Priority_Column
and it will give you: job,read,door,book.give
honar abubakrPosted Sep 14, 2013, 2:36 AM
know it's clear or not?
Hemant SrivastavaPosted Sep 13, 2013, 3:55 PM