Paulinjsh Posted December 29, 2004 Report Share Posted December 29, 2004 (edited) Problēma sekojoša. Vajag vairākās tabulās saskaitīt vai tur ir ieraksti kuros user = kautkas. Raxtu SELECT COUNT(*) FROM `Addressies`, `Changes`, `Cities` WHERE `Addressies`.`User` = 1 AND `Changes`.`User` = 1 AND `Cities`.`User` = 1 Atgriež man rezultātu COUNT(*) = 0, lai gan apskatoties šīs tabulas tajās ir ierakti, kuros User = 1. Gaidu jebkuru risinājumu. Edited December 29, 2004 by Paulinjsh Link to comment Share on other sites More sharing options...
MC_ Posted December 29, 2004 Report Share Posted December 29, 2004 Problēma sekojoša. Vajag vairākās tabulās saskaitīt vai tur ir ieraksti kuros user = kautkas. Raxtu SELECT COUNT(*) FROM `Addressies`, `Changes`, `Cities` WHERE `Addressies`.`User` = 1 AND `Changes`.`User` = 1 AND `Cities`.`User` = 1 Atgriež man rezultātu COUNT(*) = 0, lai gan apskatoties šīs tabulas tajās ir ierakti, kuros User = 1. Gaidu jebkuru risinājumu. 12400[/snapback] Ja tas ir tas ko tu veeleejies resp. atgrieziis daudzumu SELECT COUNT(Addressies.*) as c1, COUNT(Changes.*) as c2, COUNT(Cities.*) as c3 FROM Addressies, Changes, Cities WHERE Addressies.User=Changes.User AND Changes.User=Cities.User AND Cities.User=1 Link to comment Share on other sites More sharing options...
Recommended Posts