SQL but i don't know how to title my problem

Results 1 to 3 of 3

Thread: SQL but i don't know how to title my problem

  1. #1
    Fatih Guest

    Default SQL but i don't know how to title my problem

    i have this code<BR><BR>use intranet<BR>select LG_201_STCARD.UNITS1,LG_201_STCARD.LOGICALREF, <BR>LG_201_STCARD.CODE, LG_201_STCARD.DEFINITION_, LG_450_01_STINVTOT.ONHAND, <BR>LG_450_01_STINVTOT.STOCKREF, LG_450_STCARD.LOGICALREF, LG_450_STCARD.CODE FROM LG_201_STCARD, LG_450_01_STINVTOT,LG_450_STCARD where LG_450_STCARD.CODE=LG_201_STCARD.Code and LG_450_STCARD.LOGICALREF=LG_450_01_STINVTOT.STOCKR EF and LG_450_01_STINVTOT.InvenNo=&#039;-1&#039;<BR><BR>problem is if there is not a corresponding values in 450 for 201 then i see noe result but i want to see al if there are values with values if not as NULL&#039;s but problem is they are not entered to database so i can&#039;t get all results i want help me pls.<BR>LG_450_STCARD.CODE=LG_201_STCARD.Code <BR>if a code from 201 not in 450 then i want to have this record too

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL but i don't know how to title my prob

    try using an "outer join" between your tables

  3. #3
    Join Date
    Dec 1969

    Default Try to explane again...

    just for readability:<BR>Select L2.UNITS1,L2.LOGICALREF, <BR>L2.CODE, L2.DEFINITION, L4.ONHAND, <BR>L4.STOCKREF, L4s.LOGICALREF, L4s.CODE<BR>FROM LG_201_STCARD L2, LG_450_01_STINVTOT L4,LG_450_STCARD L4s <BR>Where L4s.CODE=L2.Code and L4s.LOGICALREF=L4.STOCKREF and L4.InvenNo=&#039;-1&#039; <BR>

Posting Permissions

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