Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2013
    Posts
    57

    Unanswered: is this code bad?

    I get 'no rows selected'

    what am I doing wrong?

    select SPORT_TYPE_NAME, TEAM.TEAM_NAME,GAME.GAME_DATE
    FROM SPORT_TYPE
    JOIN SPORT ON SPORT_TYPE.SPORT_TYPE_CODE = SPORT.SPORT_TYPE_CODE
    JOIN TEAM ON SPORT.SPORT_ID = TEAM.SPORT_ID
    JOIN GAME ON TEAM.TEAM_ID = GAME.TEAM_ID
    WHERE GAME.RESULT IS NULL
    AND SPORT.SPORT_ID = '6';

  2. #2
    Join Date
    Dec 2012
    Location
    Logan, Utah
    Posts
    163
    Quote Originally Posted by bwilson95 View Post
    I get 'no rows selected'

    what am I doing wrong?
    In all seriousness I would like to ask, "How the hell could anyone know?"

    We could venture guesses but nobody can tell you for sure what is wrong because of the following reasons:

    1. You have no DDL.
    2. You have no insert statements with data.
    3. You have not provided expected output.
    4. You have not provided the error message (if any)

    I have read most of your posts and every time someone asks for these things you fail to provide them. What you have provided in the past is NOT, I repeat, NOT valid DDL.

    Help yourself by providing what is asked for! If you do not know what DDL is, please Google it. There are literally 1000's of sites that can help with this.
    https://www.google.com/search?q=sql+...-US:unofficial

    As to what is wrong with your current statement . . .

    Your data has no columns where game.result is null and no sport_id = 6. Remove the where clause and see what you get. But this is just guessing.
    Last edited by LinksUp; 10-11-13 at 21:49.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I get 'no rows selected'
    >what am I doing wrong?
    You asking questions without providing necessary details to solve your mystery.

    if 1 or more rows "should" be returned, then posted SQL is wrong, but we have nothing determine what is wrong or what change may be required to make thing right.

    It would be helpful if you provided DDL (CREATE TABLE ...) for tables involved.
    It would be helpful if you provided DML (INSERT INTO ...) for test data.
    It would be helpful if you provided expected/desired results & a detailed explanation how & why the test data gets transformed or organized.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  4. #4
    Join Date
    Dec 2007
    Posts
    253
    I see you're back to asking for help but not responding to those who try to help you. Is it that hard for you to keep track of all the questions that you've got out there?

  5. #5
    Join Date
    Sep 2013
    Posts
    57
    Quote Originally Posted by anacedent View Post
    >I get 'no rows selected'
    >what am I doing wrong?
    You asking questions without providing necessary details to solve your mystery.

    if 1 or more rows "should" be returned, then posted SQL is wrong, but we have nothing determine what is wrong or what change may be required to make thing right.

    It would be helpful if you provided DDL (CREATE TABLE ...) for tables involved.
    It would be helpful if you provided DML (INSERT INTO ...) for test data.
    It would be helpful if you provided expected/desired results & a detailed explanation how & why the test data gets transformed or organized.
    Figured it out, we're not as advanced as create table statements yet, or insert statements, as of now.

  6. #6
    Join Date
    Sep 2013
    Posts
    57
    Quote Originally Posted by pablolee View Post
    I see you're back to asking for help but not responding to those who try to help you. Is it that hard for you to keep track of all the questions that you've got out there?
    No, is it hard to be so bitter, knowing that some random stranger does not bend to your wishes?

  7. #7
    Join Date
    Dec 2007
    Posts
    253
    Quote Originally Posted by bwilson95 View Post
    No, is it hard to be so bitter, knowing that some random stranger does not bend to your wishes?
    Reel your neck in child.
    It's not about 'bending' to anyone's wishes. It's about having a modicum of common courtesy. You're on here asking people to give up their time for free to help you do your homework. Have the courtesy to respond to them when they ask you for information instead of just blanking posts because it's too difficult a request for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •