Perumal
Perumal

Reputation: 69

Join Multiple table without using joins

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..

Upvotes: 0

Views: 11165

Answers (4)

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);

Upvotes: 0

Backbencher
Backbencher

Reputation: 21

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

Upvotes: 0

Neo Vijay
Neo Vijay

Reputation: 873

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

Upvotes: 1

Raging Bull
Raging Bull

Reputation: 18767

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.

Upvotes: 2

Related Questions