Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select - SQL dilemma
Message
From
21/07/1998 16:59:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00119839
Message ID:
00119891
Views:
16
Hi Bill ---

Thanks. I was trying to use View Designer and it was misplacing certain keywords in the SELECT statement and I couldn't remember them....this was embarrassing, almost like forgetting your kid's name or something :)

Thanks again.


>John --
>
>Here is a quick example. My code uses OUTER JOINs, but the idea is similar for your INNER JOIN situation.
>
>HTH -- Bill
>
>PS -- This code was all nicely formatted with indentation, etc., but it is hard to say what it sill look like when I click the SEND button...hope it is easy for you to read.
>
>CREATE SQL VIEW lv_Family_Students AS ;
> SELECT Student.StudentID, Student.LastName, ;
> Student.FirstName, Student.MiddleInitial, ;
> Student.BirthDate, Student.Gender, ;
> Student.AddressID, ;
> Location.LocationName, ;
> RCurric.CurriculumName, ;
> RProgram.ProgramName, ;
> RRank.RankName, ;
> RStatus.StatusName ;
> FROM MAT!Student ;
> LEFT OUTER JOIN MAT!Location ;
> ON Student.LocationID = Location.LocationID ;
> LEFT OUTER JOIN MAT!RCurric ;
> ON Student.CurriculumID = RCurric.CurriculumID ;
> LEFT OUTER JOIN MAT!RProgram ;
> ON Student.ProgramID = RProgram.ProgramID ;
> LEFT OUTER JOIN MAT!RRank ;
> ON Student.RankID = RRank.RankID ;
> LEFT OUTER JOIN MAT!RStatus ;
> ON Student.StatusID = RStatus.StatusID ;
> WHERE Student.FamilyID = ?Family.FamilyID ;
> ORDER BY Student.LastName, Student.FirstName
>
>>I have a problem getting my syntax down on the following problem:
>>
>>I have a table which contains a status code,an employee code,and a resolution code. I want to create a view that is an INNER JOIN between the master table and three subtables (status,employee,resolution) containing a descriptive field from each subtable in the result view.
>>
>>Can somebody post a good example of this? Thanks
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform