Reputation: 69
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
Reputation: 1
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
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
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
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