JOIN in on the fun

Results 1 to 3 of 3

Thread: JOIN in on the fun

  1. #1
    Join Date
    Dec 1969

    Default JOIN in on the fun

    My search engine gives the option to search all files, by description, file number and file name. <BR><BR>The "all" option, I&#039;m doing the following: <BR>Select F.Filenum, F.Description, F.Name, S.Subfiletype From File F Left Join Subfiletype S on F.Subfiletype=S.SubfiletypeID<BR><BR>This returns all files, whether they have a subfiletype id or not. For those that do, it returns the name of the subfiletype instead of just the ID.<BR><BR>However, I need to now modify the sql statement to search by the various search criterion - eg) name, description<BR><BR>what would the syntax look like? <BR>I still want to be able to look up the subfiletype names via the join statement. <BR>Would I have another "where" clause that says :<BR>"WHERE DESCRIPTION LIKE %strDescription%" ?<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default What do the docs say?? <eop>


  3. #3
    Join Date
    Dec 1969

    Default One caution...

    ...see if this makes sense to you:<BR><BR><BR><BR>So if your WHERE clause is supposed to apply to one of the tables where the record may not be there, do *NOT* make it part of the WHERE! Move it into the appropriate ON, instead.<BR><BR>If you WHERE applies to the FILE table, then it makes no difference.<BR><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