|
Count Problem
Hi All!
i am having a big problem doing following query?
question is "List the titles and creation dates of all blogs, as well as the total number of blog entries associated with that blog?"
the query should look at the "Subject_Title" in the blog_Entries table and "PostComment" field from PostReply table. the count should count the Subject_title and how many post reply it has for that subject.
this is my code
"select BLOG_ENTRIES_ID,Creation_DATE, count(PostComment)
from Blog_Entries, PostReply
where Subject_Title=PostComment
group by BLOG_ENTRIES_ID,Creation_DATE;"
i have try everything i don what to do now? please help me
i have below list the two tables;
thanking u in advance
bye
Mo
==================================================
CREATE TABLE Blog_Entries
(BLOG_ENTRIES_ID VARCHAR2(20) PRIMARY KEY,
EMAIL VARCHAR2(20), CONSTRAINT Blog_Entries_FOREIGN_KEY FOREIGN KEY (EMAIL) REFERENCES Bloggers (EMAIL),
Creation_DATE DATE DEFAULT SYSDATE,
Subject_Title VARCHAR2(40),
Entries_Text VARCHAR2(160));
==================================================
CREATE TABLE PostReply
(POST_REPLY_ID VARCHAR2(8) PRIMARY KEY,
BLOG_ID VARCHAR2(10), CONSTRAINT PostReply_FOREIGN_KEY FOREIGN KEY (BLOG_ID) REFERENCES Blog (BLOG_ID),
Subject VARCHAR2(40),
PostComment VarChar2(1000),
REPLY_DATE DATE DEFAULT SYSDATE);
==================================================
|