Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
esambath
Yak Posting Veteran
89 Posts |
Posted - 2009-06-22 : 10:38:19
|
| Hi expert,please help this queryI have two table LP_AskaQuestion and LP_AnswerLP_AskaQuestionAskaQuestionId Question1 What is asp?2 What is php?3 what is java?LP_AnswerAnswerId AskaQuestionId Answer1 1 Active server pageoutput (To display the pending question)AskaQuestionId Question2 what is php?3 what is java?Thanks an Advance |
|
|
vijayisonly
Master Smack Fu Yak Hacker
1836 Posts |
Posted - 2009-06-22 : 10:43:28
|
| SELECT a.AskaQuestionId, a.Questionfrom LP_AskaQuestion a LEFT JOIN LP_Answer bon a.AskaQuestionId = b.AskaQuestionIdWHERE b.AskaQuestionId IS NULL |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-22 : 10:48:27
|
| [code]SELECT *FROM LP_AskaQuestion qWHERE NOT EXISTS (SELECT 1 FROM LP_Answer WHERE AskaQuestionId=q.AskaQuestionId)[/code] |
 |
|
|
|
|
|