Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two tables table adminlogin and table adduser.I need to join the userid,username of table adduser with logintype from table adminlogin where login type should be marketing.
Posted

Here are some very good examples you can learn from here...

http://blog.sqlauthority.com/2009/04/13/sql-server-introduction-to-joins-basic-of-joins/[^]

Hope This Helps
-----------------
Pratik Bhuva
 
Share this answer
 
select a.userid,a.username, b.logintype from adduser a join adminlogin b on
a.col1 =b.col1
where b.logintype ='marketing'
 
Share this answer
 
SQL
SELECT t1.userid,t1.username FROM adduser t1 INNER JOIN adminlogin t2
ON t1.userid = t2.userid AND t1.login where type='marketing'
 
Share this answer
 
v2
Comments
[no name] 6-Nov-13 0:31am    
Where clause is missing..
LaxmikantYadav 6-Nov-13 0:50am    
Both query will produce the same output :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900