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


Hemant SrivastavaRank #581 · 4.2K reputationPosted Sep 13, 2013, 11:55 AM EDT
honar abubakr62 reputationPosted Sep 13, 2013, 10:36 PM EDT
know it's clear or not?
Hemant SrivastavaRank #581 · 4.2K reputationPosted Sep 16, 2013, 9:54 AM EDT
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
Suthish NairRank #92 · 22.8K reputationPosted Sep 17, 2013, 1:14 AM EDT