Example you had a two table with the column name below.
table 1
name: table_sample1
columns:
column_1
columna_2,
columna_3,
columna_4
table 2
name: table_sample2
columns:
column_1
columnb_2,
columnb_3,
columnb_4,
Suppose that the common column between table_sample1 and table_sample2 was the column named column_1
create a query for the first table
<cfquery datasource="datasource1" name="table1" >
SELECT *
FROM table_sample1
<cfquery >
create a query for the second table
<cfquery datasource="datasource2" name="table2" >
SELECT *
FROM table_sample2
<cfquery >
now here is the code for joining the two tables together.
<cfquery dbtype="query" name="joined_tables" >
SELECT *
FROM
table1,
table2
WHERE
table1.first_name = table2.first_name
<cfquery >
Thats it guys, hope that works for you.
No comments:
Post a Comment