ok so I have two tables, and I believe I need an outer join

lets say these are them:

CREATE TABLE t1 (
     xid INT PRIMARY,
     data1 VARCHAR(50) );

CREATE TABLE t2 (
     xid INT PRIMARY,
     data2 VARCHAR(50) );

so here is an explanation of the tables

t1.xid = t2.xid

for every row in t1.xid, there is a guaranteed matching t2.xid, but the same in not true in reverse

now I want to do somthing like this:
SELECT t1.xid, t1.data1, t2.data2
FROM t1,t2
WHERE t1.xid=t2.xid

but I want it to select EVERY row in t1 AND t2 even if a row does not exsist in both tables

Thanks.

don't use mysql buth this works in ms-sql:

select t1.xid,t1.data1, t2.data2 from t1
right join t2 on
t1.xid = t2.xid

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.