Let F be any field and A1,…,Am be finite subsets of F. We determine the maximum number of common zeroes a linearly independent family of r polynomials of degree at most d of F[x1,…,xm] can have in A1×…×Am. In the case when F is a finite field, our results resolve the problem of determining the generalized Hamming weights of affine Cartesian codes. This is a generalization of the work of Heijnen and Pellikaan where these were determined for the generalized Reed–Muller codes. Finally, we determine the duals of affine Cartesian codes and compute their generalized Hamming weights as well. © 2018 Elsevier Inc.