如何从连续字段中选择 [英] How to Select from a Concatenated Field

查看:72
本文介绍了如何从连续字段中选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子,里面有一个位置(城市,州,国家)。我需要编写一个查询来获取其中包含值的所有记录。



例如,我希望能够输入'a',并且返回城市,州或国家/地区所有记录的查询。



感谢任何可以提供帮助的人!

解决方案

  SELECT  * 
FROM 位置
WHERE 城市 LIKE ' a%' 状态 LIKE ' a%' 国家 LIKE ' a%'



更多: 12.5.1。字符串比较函数 [ ^ ]


I have a table that has a location in it (City, State, Country). I need to write a query that will get all records with a value in it.

So for example, I would like to be able to input 'a', and the query to return all records where the city, state, or country has 'a' in it.

Thanks to anyone who can help!

解决方案

SELECT *
FROM Location
WHERE City LIKE 'a%' OR State LIKE 'a%'OR Country LIKE 'a%'  


More: 12.5.1. String Comparison Functions[^]


这篇关于如何从连续字段中选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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