BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with SQL Query (MySQL 4.0)

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Bojan
Guest





PostPosted: Sun Jul 03, 2005 8:01 pm    Post subject: Help with SQL Query (MySQL 4.0) Reply with quote



Hello,

I am trying to made some kind of simple forum, but I have problem with one
SQL Select Query. Please note that I am using v4.0 of MySQL and that I can't
use sub-queries.

I have next tables in my simple database:

members
---------
id INT (AUTOINC/Index)
name CHAR

groups
------
id INT (AUTOINC/Index)
name CHAR

topics
------
id INT (AUTOINC/Index)
post_date DATETIME
group_id INT
title CHAR

posts
-----
id INT (AUTOINC/Index)
topic_id INT
member_id INT
first_post TINYINT
text VARCHAR

What I want, is to display next data in Grid:

Column 1: Group name
Column 2: Date of last changed TOPIC in Group
Column 3: Name of last changed TOPIC in Group
Column 4: Name of Member of last post in Group
Column 5: Number of Topics inside Group
Column 6: Number of Posts inside Group

I will really like to display this (if is possible) with using one query (no
matter how complicated is). I have try many things and all I have made is to
get 3 of 6 columns :(

Thanks for all help.
Bojan



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.