| | |||||
| ||||||||
| 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: May 2006
Posts: 39
![]() | need mysql help Hello I am writeing a forum and for soem reason my mind has taken a dump and i cant figure out the query I have a signle table that has the following cols thread_type_id thread_name poster post Date_posted thread_order thread_id and a key I need to figure out based on the thread type id how many posts there has been for that thread type id minus the ones that are marked first How mnay are marked first and when the last post was made for that thread type id Could anyone help me out with this
Last edited by Coreycyberdesig; 06-20-2006 at 06:33 AM.
|
| |
| | #6 (permalink) | ||||||||||||||||
| New Member Join Date: Jun 2006
Posts: 10
![]() |
Code: SELECT COUNT(the_key) FROM `your_single_table` WHERE thread_type_id = 'variable_for_that_thread_type_id' AND what_field_was_that != 'first'
Code: SELECT COUNT(the_key) FROM `your_single_table` WHERE what_field_was_that = 'first'
Code: SELECT MAX(Date_posted) FROM `your_single_table` WHERE thread_type_id = 'variable_for_that_thread_type_id' | ||||||||||||||||
| |