MySqlTalk.com  

Go Back   MySqlTalk.com > MySQL > SQL syntax
User Name
Password
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread
Old 10-01-2005, 07:06 AM   #1
feedexa
Junior Member
 
Join Date: Oct 2005
Posts: 1 feedexa is on a distinguished road
Subquery rewrite for MySQL 4.0

Can anyone help with rewriting this:

Code:
SELECT feeds.id, feeds.title, feeds.url, (SELECT COUNT(item_id) FROM feeds_items WHERE feeds_items.item_id NOT IN (SELECT item FROM users_items_read WHERE user = users_to_feeds.user AND feed = feeds.id) AND feeds_items.feed_id = feeds.id GROUP BY feed_id) AS 'unread' FROM users_to_feeds INNER JOIN feeds ON feeds.id = users_to_feeds.feed WHERE users_to_feeds.user = '1' GROUP BY feeds.id ORDER BY feeds.title ASC

using only joins, so that its compatible with MySQL 4.0. I've tried but cannot do it.

Cheers,
feedexa is offline   Fork this post Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -4. The time now is 08:40 PM.



Powered by: vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Google
  Web http://www.mysqltalk.com
DISCLAIMERS:
1. We have no commercial interest in this site.
Banner Ads and Subscriptions will only be used to help pay for hosting and maintenance costs.
2. MySQLTalk.com is NOT affiliated with MySQL AB in any way.
3. MySQLTalk.com is NOT endorsed by MySQL AB in any way.
4. Please do not post any content that is harmful to MySQL or MySQL AB, meaning no misleading or obsolete information will be tolerated.
Well-founded constructive criticism meant to help the community is permitted.
5. This website is founded with the goal of improving the MySQL community.
We not only tolerate newbies, we encourage them.
Please do not ask newbies to "read the manual".