| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Jan 2007
Posts: 98
![]() | query to show duplicated entries. hello all, this is what i use to show the the data from mysql. PHP Code: ????: NamePros.com http://www.namepros.com/programming/668976-query-to-show-duplicated-entries.html My question is what do i need to change here to show only duplicated entries according to topic field. Thanks all.
__________________ |
| | |
| | THREAD STARTER #3 (permalink) | ||||
| NamePros Member Join Date: Jan 2007
Posts: 98
![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=668976 What about the total count for the first query? thanks
__________________ | ||||
| | |
| | #4 (permalink) |
| New Member Join Date: Jul 2010 Location: Boston, MA
Posts: 5
![]() | I'm not sure I follow what you're looking to do in the first query. You're selecting a single row, i.e., the count of the entire table. If you want the count for just a particular topic, it'd be: Code: SELECT COUNT(*) FROM file WHERE topic = '<my_topic>'; ????: NamePros.com http://www.namepros.com/showthread.php?t=668976 Code: SELECT topic, COUNT(*) FROM file GROUP BY topic HAVING COUNT(*) > 1; |
| | |