stencilz Posted April 1, 2007 Report Share Posted April 1, 2007 ir viena tabula table1 kurā ir usera id un priekšmeta id lietotājs | priekšmets un otra tabula table2 kurā ir priekšmeta id un priekšmeta tips priekšmets|tips man vajag lai selecto rindu skaitu no table1 kurā priekšmeta tips ir 1, kā to izdarīt? Link to comment Share on other sites More sharing options...
martins256 Posted April 1, 2007 Report Share Posted April 1, 2007 SELECT COUNT(*) FORM tabula WHERE ... Link to comment Share on other sites More sharing options...
stencilz Posted April 1, 2007 Author Report Share Posted April 1, 2007 tik daudz es arī saprotu, taču man vajag turpinājumu, kā lai selekto skaitu priekšmetiem kuru tips tiek ņemts no citas tabulas? Link to comment Share on other sites More sharing options...
martins256 Posted April 1, 2007 Report Share Posted April 1, 2007 http://www.webdevelopersnotes.com/tutorial...able_joins.php3 Link to comment Share on other sites More sharing options...
andrisp Posted April 1, 2007 Report Share Posted April 1, 2007 SELECT COUNT(*) FROM `tabula1` t1, `tabula2` t2 WHERE t1.prieksmets = t2.prieksmets AND t2.tips = 1 Link to comment Share on other sites More sharing options...
Recommended Posts