Someone may answer you here but the group http://groups.yahoo.com/group/SQLqueriesNoCode/ will help you the most. Tons of experts on Joins, Agregate and other sytax tricks that transcend ASP.net and pertain to SQL in general.
On 4/14/05, Jupiter Nyamadi <[EMAIL PROTECTED]> wrote: > Hi, > > I have two tables named "instructors" and "employees". The table > "instructors" contains details of course instructors inside and > outside the organisation while the table "employees" contains details > of course instructors within the organisation. > If the instructor is within the organisation, then only the employeeId > is saved in the "instructors" table and his details retrieved from the > "employees" table. If the instructor is outside the organization then > his details like firstname, lastname, middlename etc are stored in the > "instructors" table. > > I need a single query that can search both tables using lastname or > firstname or middlename fields. > > I tried the following but it didn't work: > > ********************************************************************************************* > Select I.*, E.* from Instructors I, Employees E where I.InstructorType > = '1' and > > I.instructor_id <> '0' and (I.lastname like '%jupiter%' or I.middlename > > like '%jupiter%' or I.firstname like '%jupiter%' or E.lastname like > '%jupiter%' or E.middlename > > like '%jupiter%' or E.firstname like '%jupiter%') order by > I.lastname, E.lastname asc > ************************************************************************************************ > > Can someone be of help? > > Thanks, > Jupiter > > ________________________________ > Yahoo! Groups Links > > > To visit your group on the web, go to: > http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
