Sub-queries

liunx

Guest
So I'm building a financial planning site that adds up all sorts of data in all sorts of places, and I believe in some cases sub-queries can make your queries a lot more efficient. So when I built my site on my local box (Mac, os 10.3, php 4.somethin, mysql 4.something, apache2.something) I used sub-queries. When I moved my site to TCH hosting I found they didn't work. So first I'm just wondering why that is, and second, what do I need to do to get up and running? Do I just need to lay low until TCH updates its mysql version? Do I need to adjust my syntax? Do I need to just revamp my code to not use sub-queries? Anyway, I'll further explain what I mean by sub-query to make sure we're on the same page.<br /><br />For example, the following query is ridiculous but shows what I mean. On my local box I can run the queries like<br />SELECT * FROM sometable WHERE sometable.blah IN (SELECT blah FROM sometable)<br />without any problems, but when I run queries like that on TCH I get your standard syntax error. <br /><br />By the way, I'm new, and I just realized I probably stuck this question in the wrong spot. sorry about that, thanks much.<!--content-->
TCH runs MySQL 4.0.22 and subqueries were only recently made available in MySQL 4.1.<br />Even though 4.1 has been considered stable since October it's more a matter of cPanel and the scripts they include being compatible with 4.1. Who knows when this could happen but until then you can try <a href="http://dev.mysql.com/doc/mysql/en/Rewriting_subqueries.html" target="_blank">Rewriting Subqueries as Joins</a>.<!--content-->
First<br /><img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/kicking.gif" style="vertical-align:middle" emoid=":dance:" border="0" alt="kicking.gif" /> Welcome to the Family <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/kicking.gif" style="vertical-align:middle" emoid=":dance:" border="0" alt="kicking.gif" /> <br /><br />and your new home!<br /><br />from my cpanel<br />PHP Version 4.3.9<br />Mysql Version 4.0.22-standard<br /><br />I can't help you with the syntax<br />but I will move it to scripting talk<br />for better exposure.<br /><br />We really are like family here.<br />So if you need anything,<br />just ask your new family!<br />We love to help <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Welcome to the family! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><!--content-->
 
Back
Top