Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > Database
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 05-31-2007, 7:40 PM   #1
MultiTaskinG
 
MultiTaskinG's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default mysql 4.0.x - ORDER BY ? GROUP BY ? please help me for "hierarchical"query

I want to retrieve all comment stored from my web users ordered BY
THREAD and BY TIMESTAMP (INT 11) with a single query (if is possible)


now I launch this query:


SELECT thread, timestamp, level FROM comments WHERE articleid=16 ORDER
BY thread, timestamp,level



the result is
--------------------------

articleid

thread

timestamp

level
Edit Delete 16 0158c01d508b7f6b439218b37b95c9d8 1118615171 0
Edit Delete 16 08852417c9150755dc79a227bdc14166 1118614496 0
Edit Delete 16 1f36e5e49a9f63c155da65d6b50cdf57 1118700152 0
Edit Delete 16 21a893b9e131f93fd74087aecd6e0ad9 1118615378 0
Edit Delete 16 23a08379da46d6ca93688bfd552a9fd2 1118616732 0
Edit Delete 16 26ddd774e9ed5027e2b63ee76e07aa63 1118614810 0
Edit Delete 16 2b8d2bc3a4921133f4f66550ff1e0b62 1118615722 0
Edit Delete 16 4ffac6f937c627710df83286427d5e77 1118700068 0
Edit Delete 16 5599e5171abe3ff1db3a1de96dd622df 1118700205 0
Edit Delete 16 5abbc47f16ae3d5e999d083357f67226 1118617178 0
Edit Delete 16 683d385ec0d315b34be5fab64b64cd4a 1118700174 0
Edit Delete 16 97139b90f82c9d54df4c727ca59dfee8 1118614046 0
Edit Delete 16 af32d2171a51c3635513f77ecff3a7cd 1118615830 0
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613704 0
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613714 1
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613734 2
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613744 1
Edit Delete 16 e10d9627b13b9e984dd8d3831cfc7c10 1118615545 0
Edit Delete 16 h599e5171abe3ff1db3a1de96dd622df 1118613716 0


----------------------------


so I have ONE UNIQUE THREAD ( e0ab7e66c7dcb4e50505d7b143f9bccf ) but
these result are't ordered by timestamp !!!!
are apparently ordered only by Thread (alfabethically).



there is the possibility to get the result ordered by TIMESTAMP and
aggregate the data by thread ?







if I make this:

SELECT thread, timestamp, level FROM comments WHERE articleid=16 ORDER
BY timestamp, thread, level


I have the result ordered by timestamp but not ordered by thread ( see
the third line )

--------------------------------
articleid

thread

timestamp

level
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613704 0
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613714 1
Edit Delete 16 h599e5171abe3ff1db3a1de96dd622df 1118613716 0
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613734 2
Edit Delete 16 e0ab7e66c7dcb4e50505d7b143f9bccf 1118613744 1
Edit Delete 16 97139b90f82c9d54df4c727ca59dfee8 1118614046 0
Edit Delete 16 08852417c9150755dc79a227bdc14166 1118614496 0
-----------------------




i Have mysql version 4.0.x
so I haven't subquery and WITH ROLLUP OPTION too :-(




Can you help me ?
thanks a lot in advance !

 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
For Sony, that performance "is simply abysmal" -- "PS3 is sucking wind right now" AirRaid Mach 2.5 Computer Consoles 33 05-30-2007 2:16 PM
For Sony, that performance "is simply abysmal" - "PS3 is sucking wind right now" elrous0@pop.uky.edu Console Subjects 7 05-29-2007 3:25 PM
For Sony, that performance "is simply abysmal" - "PS3 is sucking wind right now" elrous0@pop.uky.edu Console Subjects 1 05-29-2007 3:24 PM
The Strange Story of the "Crackpot" Mail-Order Prophet Advanced Web Technologies Building An Internet Business 0 05-29-2007 12:44 AM
some shortcut keys not working anymore-----help"""""""" Kadaitcha Man Windows 1 05-28-2007 10:28 PM


Featured Websites




All times are GMT +1. The time now is 3:42 PM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98