Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PERFORM A QUERY ON MORE THAN ON DATA FILE 1

Status
Not open for further replies.

wilsong21

Programmer
Mar 4, 2006
7
US
PERFORM A QUERY ON MORE THAN ONE DATA FILE WITH THE SAME
DATA FIELDS IN ALL DATA FILES TO GET THE TOTAL RESULTS IN THE QUERY OF ALL DATA FILE COMBINED.

EXAMPLE OF MY CODE.

SELECT SHOENAME,SHOESIZE,COUNT(SHOENAME) FROM A1NSSRT.DBF,A2NSSRT.DBF,A3NSSRT.DBF GROUP BY SHOENAME
 
Keep in mind that if you want ALL records to be selected you must use UNION ALL, becuase UNION ignores all duplicated records. Also Put all non agregated fields in GROUP BY clause.

Borislav Borissov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top