Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View from Multiple Tables
Message
From
15/01/2004 11:44:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/01/2004 11:25:18
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00867048
Message ID:
00867165
Views:
25
>Cetin,
>
>I guest I am to tired or just don't know what I am doing. Can you explain where the t3 table comes into play?
>
>Right now after I create the view I get an error that the index file is not right when I try to modify.

t3 is the same table as t2 (used again in joins). Graphically it looks like :
Master Table (t1)
   +----------DetailTable (t2)
   +----------DetailTable (t3)
ie:
Create Cursor table1 (pkid i, company c(10))
Create Cursor table2 (parentID i, task c(30), pctComp i)

For ix=1 to 20
	Insert into table1 values (m.ix,'Company'+Padl(m.ix,3,'0'))
	If m.ix%2=0
		Insert into table2 ;
			values (m.ix, "Load Common Structure", 20)
	endif
	If m.ix%3=0
		m.llTosCoin = ( Int(Rand()*100)%2 = 0 )
		Insert into table2 ;
			values (m.ix, "Load Final Structure", ;
			Iif(m.llTosCoin,100,80))
	endif
EndFor

Select t1.pkid, t1.Company, ;
	t2.Task as CommTask,t2.pctComp as Commpct, ;
	t3.Task as FinalTask,t3.pctComp as Finalpct ;
 from table1 t1 ;
 inner join table2 t2 on t1.pkid = t2.parentID ;
 	and t2.task == "Load Common Structure" ;
 inner join table2 t3 on t1.pkid = t3.parentID ;
    and t3.task == "Load Final Structure" and t3.pctComp < 100
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform