如何组合数据库中的两列并将其用于where子句? [英] How do I combine two columns from database and use it into where clause ?

查看:64
本文介绍了如何组合数据库中的两列并将其用于where子句?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何组合两个列,让我们使用它作为名称来说明数据库中的firstname和lastname?

我想将这个全名用于where子句。

How do I combine two columns lets say firstname and lastname from database using it as name ?
I want to use this fullname into where clause.

推荐答案

试试这个:

Try this:
select * from table1 where firstname + ' ' + lastname = 'peter leow'


这篇关于如何组合数据库中的两列并将其用于where子句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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