Jump to content

Archived

This topic is now archived and is closed to further replies.

tecdesign

SQL HAVE in statement

Recommended Posts

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.

Share this post


Link to post
Share on other sites

[code]SELECT * FROM `topics`
WHERE `topicarea` = 'general'
ORDER BY topicid DESC
LIMIT 1;[/code]

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.