Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 2 orders, one after the other

Author  Topic 

zebbb
Starting Member

3 Posts

Posted - 2008-07-13 : 17:19:20
I'm a noob to sql and I've been using a query thats worked really well for me for some time, but now I need to optimise it a little further and things seem to be coming un-done

its used for a search query:

SELECT Users.Name, Users.Summ, Users.title, Users.URL, Users.Location, Users.Subject, Users.ImgHeight, Users.ImgWidth, Props.inLink_count,
MATCH(Users.Name, Users.Summ, Users.title, Users.Location, Users.Subject)
AGAINST ('$srch' IN BOOLEAN MODE) AS score FROM Users, Props
WHERE MATCH(Users.Name, Users.Summ, Users.title, Users.Description, Users.Location, Users.Subject)
AGAINST ('$srch' IN BOOLEAN MODE)
ORDER BY score DESC LIMIT 20


but now I want to first order it by Props.inLink_count and then order it by score DESC LIMIT 20 (so its ordered by in bound links 1st then relavance so relavance takes prority)

but :
ORDER BY Props.inLink_count DESC, score DESC LIMIT 20
doesnt work, what am I doing wrong here (complete sql noob)

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-13 : 17:43:19
This doesn't look like SQL SERVER. Are you in right forum?
Go to Top of Page

zebbb
Starting Member

3 Posts

Posted - 2008-07-13 : 18:32:40
possibly not :s
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-13 : 19:35:16
Then what is it? you should post in dbforums.com if its not SQL related.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-14 : 03:42:24
If the question is related to mysql, post at www.mysql.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -