IM24LV Posted August 25, 2007 Report Share Posted August 25, 2007 Tātad kas jādara, lai tabulā vienā kolonā katrā lauciņā parādītu sekojošus skaitļus? 1 valdis 2 jānois 3 blamers 4 trakters 5 kefīrs cerams ka domu sapratāt... :) Link to comment Share on other sites More sharing options...
bubu Posted August 25, 2007 Report Share Posted August 25, 2007 mja.. loģiskās domāšanas trūkst? $i = 1; while (...) { echo $i, "\n"; $i++; } Link to comment Share on other sites More sharing options...
IM24LV Posted August 26, 2007 Author Report Share Posted August 26, 2007 paldies! Link to comment Share on other sites More sharing options...
IM24LV Posted August 26, 2007 Author Report Share Posted August 26, 2007 Lia netaisītu mēslus, ierakstīšu tepat, lūdzu pasakiet, nevaru izdomāt, kā panākt lai atlasa ierakstus tikai tad, ja noteiktie ID ir vismaz noteikts skaits? SELECT rating_item_id, SUM(rating_vote) / COUNT(rating_item_id) as rating_rating, COUNT(rating_item_id) as r_count FROM DB_ratings WHERE rating_type = 'A' AND (SELECT COUNT(rating_item_id) FROM DB_ratings WHERE rating_type = 'A') GROUP BY rating_item_id ORDER BY rating_rating DESC, r_count DESC LIMIT 100 COUNT(rating_item_id) šis te saskaita cik pavisam ir balsu noteiktajam ierakstam tātad vajadzētu kkā to iesasitīt. ceru ka var saprast kas un kā :) Link to comment Share on other sites More sharing options...
bubu Posted August 26, 2007 Report Share Posted August 26, 2007 HAVING r_count = 10 Link to comment Share on other sites More sharing options...
IM24LV Posted August 26, 2007 Author Report Share Posted August 26, 2007 Nesapratu, kur tad tas būtu jāraksta. Link to comment Share on other sites More sharing options...
bubu Posted August 26, 2007 Report Share Posted August 26, 2007 Šeit ir uzrakstīts, kur tas ir jāliek: http://dev.mysql.com/doc/refman/5.0/en/select.html Link to comment Share on other sites More sharing options...
IM24LV Posted August 26, 2007 Author Report Share Posted August 26, 2007 Liels paldies! Link to comment Share on other sites More sharing options...
Recommended Posts