Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT Statement For a Particular Record from a Set
Message
From
14/10/2016 15:38:30
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SPT Statement For a Particular Record from a Set
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008 R2
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01641968
Message ID:
01641968
Views:
44
I have a table where a job number field can have multiple records. It has a field also that holds an archive flag.

I need a SQL statement that will only result in a list of job numbers that when grouped together not one of them has an archive flag value of 0.

The following will give me job numbers that I do not desire. Because for instance job number MES4000 is listed 3 times with two records with archive flag set to 1 an one record set to 0.
So I would not want this in my result.
testconnString = "Select Distinct jobno, archivef From webprddt1.resmngta0" +;
				" Where posstr(jobno,'MES') > 0 And archivef = 1"
Next
Reply
Map
View

Click here to load this message in the networking platform