Join Multiple table without using joins

11.1k Views Asked by At

I have two tables like

StudPersonalinfo
-----------------
studid,studname,father name,address,state,city,ExtraCurricularActivities 

and another table is

Mark  
------------------
studid,studname,m1,m2,m3

Is there any other way to join these two tables without using join conditions? Can anyone please help me..

4

There are 4 best solutions below

2
On BEST ANSWER

please try this Sql View

step 1 create view with join

CREATE VIEW StudentDetails
As
SELECT 
    t1.studID, 
    t2.studName,  
    t2.Mark1, 
    t2.Mark2  
FROM 
    Table1 t1
    LEFT JOIN Table2 t2 ON t1.column = t2.column

step 2 use this view in single query like below.

SELECT * from StudentDetails
2
On

You can also do it using WHERE clause:

SELECT *
FROM StudPersonalinfo S, Mark M
WHERE S.studid=M.studid

I would still recommend using JOIN. It is the best practice.

1
On

select empno from emp intersect select empno from audit_emp

SELECT * FROM customers WHERE EXISTS (SELECT * FROM order_details WHERE customers.customer_id = order_details.customer_id);

0
On

Use UNION instead of JOIN. Also can use comma as

1/

SELECT * 
    FROM A UNION B 
WHERE condition

2/

SELECT * 
   FROM A,B 
WHERE condition