tecdesign Posted April 24, 2006 Share Posted April 24, 2006 ok here is the sql statement[code]SELECT * FROM `topics` WHERE `topicarea` == general HAVE `topicid` >all(select `topicid` from `topics')[/code]What I am trying to say is that the topicarea is general and topicid as the greatest where in my php I will use have the greatest topic id minus $i which will be inside a while loop. Quote Link to comment https://forums.phpfreaks.com/topic/8306-sql-have-in-statement/ Share on other sites More sharing options...
Barand Posted April 24, 2006 Share Posted April 24, 2006 [code]SELECT * FROM `topics` WHERE `topicarea` = 'general' ORDER BY topicid DESC LIMIT 1;[/code] Quote Link to comment https://forums.phpfreaks.com/topic/8306-sql-have-in-statement/#findComment-30292 Share on other sites More sharing options...
sanfly Posted April 24, 2006 Share Posted April 24, 2006 By the way, i believe the correct syntax is HAVING, not HAVE[a href=\"http://dev.mysql.com/doc/refman/5.0/en/select.html\" target=\"_blank\"]MYSQL SELECT SYNTAX[/a] Quote Link to comment https://forums.phpfreaks.com/topic/8306-sql-have-in-statement/#findComment-30296 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.