thanks. I'm asking if i can get my account put on a server which supports 4.1 or higher...in the mean time, is there a work around to fix this that you might be able to come up with if I can't upgrade? Thanks :)
Main Topics
Browse All TopicsI am getting the following error
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT DISTINCT post_id FROM wp06_post2cat WHERE post_id NOT IN]
and the sql statement looks like this:
SELECT DISTINCT YEAR(p.post_modified) as year, DATE_FORMAT(p.post_modifie
SELECT DISTINCT post_id FROM wp06_post2cat WHERE post_id NOT IN (
SELECT post_id FROM wp06_post2cat WHERE category_id IN (5, 7))) AS p2 ON (
p2.post_id=p.ID)WHERE p.post_status='publish' ORDER BY 1, MONTH(p.post_modified)
yet, all tables and field names exist and have data in them to be grabbed. Specifically, wp06_post2cat table does exist, and does have a post_id column. I'm running MySQL version 4.0.18
Any ideas what the issue is?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
It will be pretty hard to convert those subqueries to a single SQL select statement that does not use subqueries. However, you can use temporary tables and a series of SQL statements to achieve the same result:
CREATE TEMPORARY TABLE p1 AS SELECT post_id FROM wp06_post2cat WHERE category_id IN (5, 7);
CREATE TEMPORARY TABLE p2 AS SELECT DISTINCT wp.post_id FROM wp06_post2cat wp LEFT JOIN p1 ON (wp.post_id=p1.post_id) WHERE p1.post_id IS NULL;
SELECT DISTINCT YEAR(p.post_modified) as year, DATE_FORMAT(p.post_modifie
DROP TABLE p1;
DROP TABLE p2;
is it okay to drop all of that into one query/
wordpress has this
$res = $wpdb->get_results(...
function to make selections to the db. when i threw all of that into the query above i get
[You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; CREATE TEMPORARY TABLE p2 AS SELECT DISTINCT wp.post_id FROM]
perhaps there is an issue with the wordpress referencing function...i dont know, but it seems to be an error of the same type... maybe the function above only allows one statement. i appreciate your help11
sorry, my shift key isn't responding
Business Accounts
Answer for Membership
by: gamebitsPosted on 2006-03-09 at 18:13:24ID: 16151218
subselect query not supported in mysql 4.0.18, upgrade to 4.1
Gamebits