Click here to Skip to main content
15,896,154 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: [newbie] Controls have to be aligned Pin
jon-8016-Jan-09 9:56
professionaljon-8016-Jan-09 9:56 
AnswerRe: [newbie] Controls have to be aligned Pin
Member 400159616-Jan-09 22:34
Member 400159616-Jan-09 22:34 
GeneralRe: [newbie] Controls have to be aligned [modified] Pin
jon-8018-Jan-09 8:28
professionaljon-8018-Jan-09 8:28 
QuestionAjax Update Pannel Pin
Member 400159616-Jan-09 1:55
Member 400159616-Jan-09 1:55 
AnswerRe: Ajax Update Pannel Pin
Paddy Boyd16-Jan-09 2:46
Paddy Boyd16-Jan-09 2:46 
AnswerRe: Ajax Update Pannel Pin
Abhijit Jana16-Jan-09 4:03
professionalAbhijit Jana16-Jan-09 4:03 
GeneralRe: Ajax Update Pannel Pin
Member 400159616-Jan-09 22:31
Member 400159616-Jan-09 22:31 
Questionsql ouery problem Pin
pragya_chaubisa16-Jan-09 1:20
pragya_chaubisa16-Jan-09 1:20 
hi,
i am having a problem in a SQLquery.
actually i am developing a project in asp.net with C# i. e. "MESSAGE BOARD". in this all the topics are displayed in gridview. but here sorting should be as per the last modified topic as well as if any user has replied more than 10 posts , then these messages should be displayed first.
i mean sticky posts should have highest priority to display first in the gridview as well as last modified topic.


the two tables from which i am accessing datas are:

Table1: "create_topic" :

Table Fields : Description
topic_id# : Topic id
group_id# : Group id
cat_id# : subgroup id/category id
username# : user name
topic_title : title of topic
topic_msg : original message
topic_create_date : date when topic is created
no_of_views : total no. of views
no_of_reply : total no. of replies to this topic
Is_sticky : If more than 10 posts by a single user then it is set to Y else N
Is_closed : ban the reply if satisfied.


Table 2: "reply_topic" :

group_id# : group id
cat_id# : category id
reply_id # :reply id
topic_id # :topic id
Username # :username
reply_msg : reply
rply_date : date when reply


can anyone tell me the query which can fulfill the purpose.

I have tried the query but not successfull:


SELECT a.topic_id, a.group_id, a.cat_id, a.username, a.topic_title, a.topic_msg, a.topic_create_date, a.no_of_views, a.no_of_reply, a.is_sticky,
a.is_closed
FROM create_topic AS a INNER JOIN
reply_topic AS b ON a.group_id = b.group_id AND a.cat_id = b.cat_id AND a.topic_create_date = b.rply_date
ORDER BY b.rply_date, a.topic_create_date
UNION
SELECT topic_id, group_id, cat_id, username, topic_title, topic_msg, topic_create_date, no_of_views, no_of_reply, is_sticky, is_closed
FROM create_topic
ORDER BY is_sticky==Y


what is wrong in it or how can i solve the problem.
also uniqueness should be maintained.
please help me.
AnswerRe: sql ouery problem Pin
Ashfield16-Jan-09 2:32
Ashfield16-Jan-09 2:32 
GeneralRe: sql ouery problem Pin
pragya_chaubisa19-Jan-09 0:53
pragya_chaubisa19-Jan-09 0:53 
GeneralRe: sql ouery problem Pin
Ashfield19-Jan-09 8:53
Ashfield19-Jan-09 8:53 
Questiongrid view display Pin
varsh1216-Jan-09 0:49
varsh1216-Jan-09 0:49 
AnswerRe: grid view display Pin
Jon Rista16-Jan-09 12:21
Jon Rista16-Jan-09 12:21 
Questionhow to remove dll reference in visual studio? Pin
mr_muskurahat16-Jan-09 0:44
mr_muskurahat16-Jan-09 0:44 
AnswerRe: how to remove dll reference in visual studio? Pin
Abhijit Jana16-Jan-09 20:55
professionalAbhijit Jana16-Jan-09 20:55 
Questionmerge two pdf Pin
bhaumikdv16-Jan-09 0:11
bhaumikdv16-Jan-09 0:11 
AnswerRe: merge two pdf Pin
SeMartens16-Jan-09 3:45
SeMartens16-Jan-09 3:45 
Question[Message Deleted] Pin
mihirkul15-Jan-09 23:33
mihirkul15-Jan-09 23:33 
AnswerCP IGNORE; repost Pin
leckey16-Jan-09 4:21
leckey16-Jan-09 4:21 
QuestionDatagrid with row movement by mouse clicking Pin
Girish48115-Jan-09 23:12
Girish48115-Jan-09 23:12 
AnswerRe: Datagrid with row movement by mouse clicking Pin
Ashfield16-Jan-09 1:28
Ashfield16-Jan-09 1:28 
QuestionCheckbox in datagrid! Pin
RajpootRohan15-Jan-09 22:37
professionalRajpootRohan15-Jan-09 22:37 
AnswerRe: Checkbox in datagrid! Pin
Christian Graus15-Jan-09 23:26
protectorChristian Graus15-Jan-09 23:26 
AnswerRe: Checkbox in datagrid! Pin
Herman<T>.Instance19-Jan-09 3:34
Herman<T>.Instance19-Jan-09 3:34 
QuestionHow to get a particular sub report of any report programaticaly ? Pin
bhaumikdv15-Jan-09 22:20
bhaumikdv15-Jan-09 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.