4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 ORDER BY Sum of multiple feilds
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Wed Aug 13, 2003 6:36 pm (20 years, 8 months ago) Reply with QuoteBack to Top

How would I order a SELECT query by the sum of 5 integer feilds? I have tried

ORDER BY strength+agility+vitality+enlightenment+sagacity

but it doesn't work.

Thanks in advance for any replys Very Happy

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Wed Aug 13, 2003 7:23 pm (20 years, 8 months ago) Reply with QuoteBack to Top

SELECT *, strength+agility+vitality+enlightenment+sagacity AS justatest FROM <table> WHERE <condition> ORDER BY justatest

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Wed Aug 13, 2003 8:04 pm (20 years, 8 months ago) Reply with QuoteBack to Top

Thank you for the very quick response. I will try it out now.

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
Iyonix
WebHelper
WebHelper


Joined: 12 Nov 2002
Posts: 82
Location: Yarm, England

PostPosted: Wed Aug 13, 2003 8:23 pm (20 years, 8 months ago) Reply with QuoteBack to Top

I just implemented your code and it worked.
Thanks again Very Happy

________________________________
Iyonix
OfflineView User's ProfileFind all posts by IyonixSend Personal Message
jayant
Team Member



Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India

PostPosted: Thu Aug 14, 2003 7:17 am (20 years, 8 months ago) Reply with QuoteBack to Top

anytime Smile

________________________________
Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test
OfflineView User's ProfileFind all posts by jayantSend Personal MessageVisit Poster's WebsiteYahoo MessengerMSN Messenger
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.125912 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme