Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:29:02+00:00 2026-05-26T22:29:02+00:00

Please refer to my example below for clearer understanding of what i’m doing. Example:

  • 0

Please refer to my example below for clearer understanding of what i’m doing.

Example:

Create View v AS
Select T.*, S.Name, Case When T.TESTDATE = S.STUDYDATE
Then 'Yes' else 'No' END AS TakenTest
From Test T, Student S
Where T.TESTPAPERID = '12345'
And T.StudentNo = S.StudentNo;

It create the view successfully. However, it populate duplicate rows with same values like:

TESTPAPERID      StudentNo      Name     TakenTest
12345            6437           John     Yes
12345            6437           John     No

How can i resolve it as i already define that if T.TESTDATE = S.STUDYDATE then show yes. Otherwise no. And not populating the same values out.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:29:03+00:00Added an answer on May 26, 2026 at 10:29 pm

    To have only one row, use this:

    MAX(Case When T.TESTDATE = S.STUDYDATE Then 'Yes' else 'No' END)
    ...
    GROUP BY <all other columns, which you haven't shown>
    

    Also, this part is poorly coded:

    T.TESTPAPERID = (Select TESTPAPERID From Student Where TESTPAPERID='12345')
    

    because it is IDENTICAL to:

    T.TESTPAPERID = '12345'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please refer to the example below. Two subplots are added, and to each a
Could you please refer me to an example of an Asp.Net application that would
How does the toggle button on mootools rte work, please refer to example on
Please refer to this post. I have become able to configure my web.config file
Please refer to this background question. After constructing this COUNT, how would I then
Please refer my previous post here . I did changes accordingly but getting error.
Please refer to the topic http://www.codeproject.com/KB/viewstate/SaveViewState.aspx . The topic demonstrates how you can save
How to build exe files from py files (compatible with win32)? please don't refer
please let me know a java multithread application which i can refer ( source
Please consider this example class: [Serializable] public class SomeClass { private DateTime _SomeDateTime; public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.