Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select records if field in 2nd table is in a list of val
Message
From
23/07/2007 17:35:37
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01242994
Message ID:
01242999
Views:
28
I did that Naomi but I keep getting the error at EXISTS. Given my day Friday, perhaps it is as simple as a typo, so I will double-check that...



>>Tables exist SQL2000 or SQL2005:
>>
>>I have 2 string values: thisform.pcInci_Id and thisform.pcParent_Id
>>I want to pull all records from one table whose inci_id value exists in a result from another table
>>
>>
>>Long Way:
>>
>>1.  Retrieve table1.inci_id field from all records in table1 where
>>       table1.inci_id = thisform.pcInci_Id
>>       or table1.inci_Id = thisform.pcParent_Id
>>       or table1.parent_id = thisform.pcInci_Id
>>       or (LEN(table1.parent_id)>0 AND table1.parent_id = thisform.pcParent_Id)
>>
>>2.  Get all fields in all records in table2 where
>>       table2.inci_id is in (the cursor result created in step 1)
>>
>>
>>For some reason I am stumped on the short way! Any ideas?
>
>
>select * from Table1 where exists (select * from ... )
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform