This topic is locked

Edit SQL query - SELECT from different tables???

8/30/2006 6:50:16 AM
PHPRunner General questions
scuba author

can I combine SELECT statements for columns located in different table into one view?

Somthin like this:
SELECT

'company',

'phone',

'e-mail',

FROM 'companies'
SELECT

'country',

FROM 'adresses'
the result should be a query with _|company|phone|e-mail|country|_combined in one view. I've tried around with no prositive result - any tips, tricks and hints?
thanks in advance

J
Jane 8/30/2006

Hi,
you can do it using join clause.

Edit SQL query on the Edit SQL query tab in the following way:

SELECT

`company`,

`phone`,

`e-mail`,

`country`

FROM `companies` inner join `adresses` on (`adresses`.`fieldname1` = `companies`.`fieldname2`)



where fieldname1 is your actual field name in the adresses table, fieldname2 is your actual field name in the companies table.

Also you can see more info in the PHPRunner Help:

http://www.xlinesoft.com/phprunner/docs/us...sql_queries.htm

T
thesofa 8/30/2006

Hi,

you can do it using join clause.

Edit SQL query on the Edit SQL query tab in the following way:

SELECT

`company`,

`phone`,

`e-mail`,

`country`

FROM `companies` inner join `adresses` on (`adresses`.`fieldname1` = `companies`.`fieldname2`)



where fieldname1 is your actual field name in the adresses table, fieldname2 is your actual field name in the companies table.

Also you can see more info in the PHPRunner Help:

http://www.xlinesoft.com/phprunner/docs/us...sql_queries.htm



As an alternative, you can use MYSQL Query Browser to create queries and views, this can be downloaded from MYSQL.com

I use the free version of Navicat, from the pcplus cover disc of about a year ago for all my mysql management, the latest version allows the creation of views too.

Both of the above are just drag and drop editors, then you can cut and paste the query to phpRunner.
HTH