Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何检查SQL中的两个字符串条件_Sql - Fatal编程技术网

如何检查SQL中的两个字符串条件

如何检查SQL中的两个字符串条件,sql,Sql,当我编写以下查询时: select * from tablename where cloumn1 = "String1" and column2 = "String2"; 我犯了一个错误 String2:无效标识符 删除双引号 像这样 select * from tablename where cloumn1 = 'String1' and column2 = 'String2'; 删除双引号 像这样 select * from tablename where cloumn

当我编写以下查询时:

select *
from tablename 
where cloumn1 = "String1" 
  and column2 = "String2";
我犯了一个错误

String2:无效标识符

删除双引号

像这样

select *
from tablename 
where cloumn1 = 'String1' 
  and column2 = 'String2';
删除双引号

像这样

select *
from tablename 
where cloumn1 = 'String1' 
  and column2 = 'String2';

你试过单引号吗?这是用于哪种RDBMS的?请添加一个标记,以指定您使用的是
mysql
postgresql
sql server
oracle
还是
db2
——还是其他完全相同的东西。单引号很有用,因为您尝试过单引号吗?这是用于哪个RDBMS的?请添加一个标记,以指定您使用的是
mysql
postgresql
sql server
oracle
还是
db2
——还是其他完全相同的东西。单引号有帮助,谢谢causita