Click here to Skip to main content
15,920,383 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Question[newbie] Pin
jon-8016-Jan-09 9:04
professionaljon-8016-Jan-09 9:04 
AnswerRe: [newbie] Pin
Christian Graus16-Jan-09 9:12
protectorChristian Graus16-Jan-09 9:12 
GeneralRe: [newbie] Pin
jon-8016-Jan-09 9:55
professionaljon-8016-Jan-09 9:55 
GeneralRe: [newbie] Pin
Christian Graus16-Jan-09 10:02
protectorChristian Graus16-Jan-09 10:02 
GeneralRe: [newbie] Pin
jon-8016-Jan-09 10:25
professionaljon-8016-Jan-09 10:25 
Questionimage problem Pin
netJP12L16-Jan-09 8:44
netJP12L16-Jan-09 8:44 
AnswerRe: image problem Pin
Guffa16-Jan-09 9:03
Guffa16-Jan-09 9:03 
Questiongetting row into textbox and update,delete in gridview Pin
mihirkul16-Jan-09 6:54
mihirkul16-Jan-09 6:54 
AnswerCP IGNORE -- THIRD TIME SAME QUESTION Pin
leckey16-Jan-09 8:27
leckey16-Jan-09 8:27 
Question[newbie] Controls have to be aligned Pin
jon-8016-Jan-09 4:56
professionaljon-8016-Jan-09 4:56 
AnswerRe: [newbie] Controls have to be aligned Pin
TylerBrinks16-Jan-09 5:01
TylerBrinks16-Jan-09 5:01 
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 

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.