This topic is locked

INNER JOIN FORMAT

11/19/2007 1:20:13 AM
PHPRunner General questions
J
joesjnr author

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=6845&image=1&table=forumtopics' class='bbc_emoticon' alt=':ph34r:' />

Dear All,
How do I do this in PHPRunner with MySQL database as shown in PHPRunner's HELP:

select a.clientid, a.green,b.red, c.amber
from (select count(flag) as green, clientid from sensorstatus
where flag='Green' group by clientid) a
inner join (select count(flag) as red, clientid from sensorstatus
where flag='Red' group by clientid) b on a.clientid=b.clientid
inner join (select count(flag) as amber, clientid from sensorstatus
where flag='Amber' group by clientid) c on a.clientid=c.clientid;


I followed this it return error.

Is the format conformed to MySQL sql syntax?
Appreciate your help.

Alexey admin 11/19/2007

Hi,
run your query directly on MySQL database and see if it shows any error.
If your query works in MySQL and don't in PHPRunner I recommend you to create a view for your query in the database using CREATE VIEW command.

Then use this view in PHPRunner.