我需要一个查询加入where子句 [英] i need a query for joining with where clause

查看:82
本文介绍了我需要一个查询加入where子句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表adminlogin和table adduser。我需要加入userid,表adduser的用户名和表adminlogin中的logintype,登录类型应该是营销。

解决方案

以下是一些非常好的例子,您可以从这里学到...



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



希望这有助于

-------- ---------

Pratik Bhuva


从adduser中选择a.userid,a.username,b.logintype加入adminlogin b on

a.col1 = b.col1

其中b.logintype ='marketing'


 < span class =code-keyword> SELECT  t1.userid,t1.username  FROM  adduser t1  INNER   JOIN  adminlogin t2 
ON t1.userid = t2.userid AND t1.login 其中 type = ' marketing'


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.

解决方案

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


select a.userid,a.username, b.logintype from adduser a join adminlogin b on
a.col1 =b.col1
where b.logintype ='marketing'


SELECT t1.userid,t1.username FROM adduser t1 INNER JOIN adminlogin t2
ON t1.userid = t2.userid AND t1.login where type='marketing'


这篇关于我需要一个查询加入where子句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆