Page 1 of 1

SQL Query help

Posted: Mon Mar 23, 2009 3:20 pm
by nishmgopal
Hi guys, this is my sql statement:

Code: Select all

 
SELECT
    Person_ID.Person_Name, Person_Skill.Skill_name, Person_Skill.Score, ID_Table.Weight, (Person_Skill.Score-ID_Table.Weight) AS total,sum(ID_Table.Weight) AS sumweight,SUM(Person_Skill.Score) AS sumscore, Job_ID.Job_Name, ID_Table.Skill_Name
FROM
    Job_ID
    JOIN ID_Table
       USING (Job_ID)
    JOIN Person_Skill
        USING (Skill_Name)
    JOIN Person_ID
        USING (Person_ID)
WHERE Person_Skill.Skill_Name='Nish'
 ORDER BY
    total
DESC
 
 
BUt it returns NULL in all the columns.... can someone please help me and suggest how I can change my query...?

Thanks

Re: SQL Query help

Posted: Mon Mar 23, 2009 4:18 pm
by JAB Creations
Hi Nish,

There is a database forum on DevNetwork, you really should be posting something like this with 91 posts.

That being said I would suggest trying your query in phpMyAdmin as it should give you some helpful information about any errors it may encounter. Also use PHP's mysql_error function to help you debug the issue. Good luck!