Page 1 of 1

Query

Posted: Mon Sep 17, 2007 8:03 am
by sandy1028

Code: Select all

select head_node,state,count(*) from jobs_detail_info where head_node in (select head_node from cluster_master where access=1 and city in (select city from centre_master where centre_name='".$centre."')) group by head_node

$res=mysql_query($res1);
        while($centr=mysql_fetch_array($res)){
        $jobs=$centr[2];
        }
In this query I should select the jobs running on head_node depending on the city and there centre names.

head_node is in jobs_detail_info and cluster_master
city is in cluster_master and centre_master.

If I fetch the query as above the displays the jobs_info which is present in that city.

All the centres displays the jobs details.

So [s]plz[/s] please help me in solving it
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.

Posted: Mon Sep 17, 2007 12:42 pm
by Christopher
You might want to try JOINing the tables.