Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

AHSTech

@AHSTech
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Self-join to return either/or results?
    A AHSTech

    Thanks David. Maybe it's getting too late here, but I can't figure out how CASE would help me, given that for any given subjectcode, each student would have EITHER a result (AssessID = 10, CritID = 35) OR a target (AssessID = 11, CritID = 42) OR both OR neither. I've got it in my head that I can only accomplish this through one or more self-joins, but the only common columns I can work with are StudentID and SubjectCode - there's no concept of a left or right table here. Or am I really suffering brain-fade (it's been a long day) :-) Derek

    Database database question

  • Self-join to return either/or results?
    A AHSTech

    Hi, given the following tables (a student assessment system): Student: StudentID StuAssess: StudentID, SubjectCode, AssessID, CritID, CritVal Each student has one row in StuAssess for each subject for each assessment or target. The round/target is identified by the AssessID and CritID. Is it possible to write a query that will return each row in StuAssess for a student where there is either a 'Result' (i.e. AssessID = 10, CritID = 35) AND/OR a 'Target' (i.e. AssessID = 11, CritID = 42), something like this as a resultset: SubjectCode, ResultCritVal, TargetCritVal so a null 'ResultCritVal' but populated 'TargetCritVal' would indicate a target without a result, null 'Target' but populated 'Result' means result without a target, and null for both columns means no result or target. I've resorted to using a 2-pass query and handling the two resultsets in my code, but if it's possible, I'd like to just have the one resultset. Hope I've managed to explain the requirement.

    Database database question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups