avatar
Rookie's question again# Database - 数据库
M*7
1
I am new to SQL.
Q1:
Here I have a column. Some rows containing the name like "c1", some others
like "b1*" or "h10$".
I just want to select the rows like "c1" but not those "b1*".
Q2:
To create a scalar UDF, how to return more than one return value?
Thanks a lot.
avatar
n*6
2
如果在sql server里面,可以用
SELECT * FROM Table1 WHERE Column1 like '[_]1'
[_]表示任意一个字符/数字。
不过你用“”表示字符串,可能你用oracle。我不知道oracle用什么表示。

【在 M***7 的大作中提到】
: I am new to SQL.
: Q1:
: Here I have a column. Some rows containing the name like "c1", some others
: like "b1*" or "h10$".
: I just want to select the rows like "c1" but not those "b1*".
: Q2:
: To create a scalar UDF, how to return more than one return value?
: Thanks a lot.

avatar
M*7
3
could I use "where column1 not like" ?

【在 n********6 的大作中提到】
: 如果在sql server里面,可以用
: SELECT * FROM Table1 WHERE Column1 like '[_]1'
: [_]表示任意一个字符/数字。
: 不过你用“”表示字符串,可能你用oracle。我不知道oracle用什么表示。

avatar
n*6
4
Yes.
Sorry I did not look at your question very carefully. In your case,
you want 'b1', not 'c1*'
You can use:
LIKE 'b1'
If you have other requirements, you can look at %, [], _, ...

【在 M***7 的大作中提到】
: could I use "where column1 not like" ?
avatar
M*7
5
sth like "where column not like '%*'.
this works but I am not sure whether it is correct

【在 n********6 的大作中提到】
: Yes.
: Sorry I did not look at your question very carefully. In your case,
: you want 'b1', not 'c1*'
: You can use:
: LIKE 'b1'
: If you have other requirements, you can look at %, [], _, ...

avatar
n*6
6
% represent unlimited characters for any values.

【在 M***7 的大作中提到】
: sth like "where column not like '%*'.
: this works but I am not sure whether it is correct

avatar
m*2
7
这个我会:
SELECT * FROM Table1
WHERE column like '%c1%'
and column not like '%b1%'

【在 M***7 的大作中提到】
: I am new to SQL.
: Q1:
: Here I have a column. Some rows containing the name like "c1", some others
: like "b1*" or "h10$".
: I just want to select the rows like "c1" but not those "b1*".
: Q2:
: To create a scalar UDF, how to return more than one return value?
: Thanks a lot.

avatar
B*g
8
看了我的link学得就是快

others

【在 m**********2 的大作中提到】
: 这个我会:
: SELECT * FROM Table1
: WHERE column like '%c1%'
: and column not like '%b1%'

avatar
n*6
9
Good.

【在 m**********2 的大作中提到】
: 这个我会:
: SELECT * FROM Table1
: WHERE column like '%c1%'
: and column not like '%b1%'

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。