alternative:
tblArticles: ArticleID,Title,Summary,ContextSubTypeID,PostDate
tblArticlePages: ArticlePageID,ArticleID,PageNum,Content
tblAuthors:AuthorID, Name
tblArticleAuthors:ArticleID,AuthorID
tblContextSubtype:ContextSubTypeID,Name
I need to get Author,PostDate,Title,tblContextSubType.Name,PageN um,Content,
- these have to grouped accordingly by the respective fields. Content
need not be grouped by.Hi
It sounds like you need to order the data rather than group it e.g.
SELECT A.Name, T.PostDate, T.Title, S.Name, P.PageNum, P.Content
FROM tblArticleAuthors B
JOIN tblAuthors A ON A.AuthorId = B.AuthorID
JOIN tblArticle T ON B.ArticleID = T.ArticleID
JOIN tblArticlePages P ON T.ArticleID = P.ArticleID
JOIN tblContextSubtype S ON T.ContextSubTypeID = S.ContextSubTypeID
ORDER BY A.Name, T.PostDate, T.Title, S.Name, P.PageNum
John
"Tech" <neeraj_bod@.yahoo.com> wrote in message
news:35130298.0404151423.65499322@.posting.google.c om...
> These are my table structures . Could you please suggest me an
> alternative:
> tblArticles: ArticleID,Title,Summary,ContextSubTypeID,PostDate
> tblArticlePages: ArticlePageID,ArticleID,PageNum,Content
> tblAuthors:AuthorID, Name
> tblArticleAuthors:ArticleID,AuthorID
> tblContextSubtype:ContextSubTypeID,Name
>
> I need to get
Author,PostDate,Title,tblContextSubType.Name,PageN um,Content,
> - these have to grouped accordingly by the respective fields. Content
> need not be grouped by.|||Hi
It sounds like you need to order the data rather than group it e.g.
SELECT A.Name, T.PostDate, T.Title, S.Name, P.PageNum, P.Content
FROM tblArticleAuthors B
JOIN tblAuthors A ON A.AuthorId = B.AuthorID
JOIN tblArticle T ON B.ArticleID = T.ArticleID
JOIN tblArticlePages P ON T.ArticleID = P.ArticleID
JOIN tblContextSubtype S ON T.ContextSubTypeID = S.ContextSubTypeID
ORDER BY A.Name, T.PostDate, T.Title, S.Name, P.PageNum
John
"Tech" <neeraj_bod@.yahoo.com> wrote in message
news:35130298.0404151423.65499322@.posting.google.c om...
> These are my table structures . Could you please suggest me an
> alternative:
> tblArticles: ArticleID,Title,Summary,ContextSubTypeID,PostDate
> tblArticlePages: ArticlePageID,ArticleID,PageNum,Content
> tblAuthors:AuthorID, Name
> tblArticleAuthors:ArticleID,AuthorID
> tblContextSubtype:ContextSubTypeID,Name
>
> I need to get
Author,PostDate,Title,tblContextSubType.Name,PageN um,Content,
> - these have to grouped accordingly by the respective fields. Content
> need not be grouped by.
No comments:
Post a Comment