Missing records when using a joined table

  • I have a very basic query (select cm.slspsn2,so.slspsn2,so.* fromcustmstr cm

    left outer joinsalesorg so on cm.slspsn2 = so.slspsn2 where cm.slspsn2 like 'fs%' order by cm.slspsn2) I know that records exist on the left side of the join but of the 4 records that return only 2 have values from the left side????? any ideas

    Steve Johnson


    Steve Johnson

  • Well...I don't see anything wrong with that. Maybe you've got an empty string or something that is joining and you can't see it?

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Do they fill the condition :

    *******************

    like 'fs%'

    ??

    Luani


    Luani

  • I have tried this statement to see what I get and nothing is returning???? I went to the table and select the 'FSAURO' straight out of the table, I know that it exists and there is only one record in the table with this value for slspsn2 (select so.slspsn2, so.* from morpheus..salesorg so where so.slspsn2 = 'FSAURO') I was thinking that I would dump the data to a txt file truncate the table and reload?????

    Steve Johnson


    Steve Johnson

  • yes the 4 values that I am looking for are ('FSALBY','FSKENT','FSAURO','FSRAIN')

    Steve Johnson


    Steve Johnson

  • I found the problem..... there was a carriage return at the end of each slspsn2's name....not sure how it got there..... I removed the return and all is well....

    Thanks guy's

    Steve Johnson


    Steve Johnson

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply