由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - one question on SQL
相关主题
[转载] 问个SQL问题SQL copy a table into a new table and add a new column
网站遭受Hack, 有哪位知道如何处理?新手请教SQL 语法问题- alias 和 join
Rookie's question againerror of executing SQL query of string concatenation (转载
SQL Server query 一问Is Oracle ODBC support batch SQL(PL/SQL procedure)?
请求SQL语句这句SQL怎么写?
求助:如何ColumName 作为变量放入queryACCESS问题, 请教!
问个SQL问题- partial outer joinSQL question...
SQL combine two tables into one table and add a new columnSQL question: update a field
相关话题的讨论汇总
话题: a1话题: sql话题: select话题: table1话题: where
进入Database版参与讨论
1 (共1页)
r***e
发帖数: 31
1
in SQL standard, if I want to search a table based on an attribute
A1(varchar(100)), I can use
SELECT * FROM TABLE1 WHERE A1=somthing;
if I try to select the records which have at least 3 words in A1, what's the
SQL command?
I tried
SELECT * FROM TABLE1 WHERE A1 LIKE '% % %';
but it does not work, anyone knows the answer?
Actually it is a exercise in Ullman's book: database system: the complete
book, Exercise 6.1.4 f).
Thanks in advance!
s***e
发帖数: 284
2
做两次join吧

【在 r***e 的大作中提到】
: in SQL standard, if I want to search a table based on an attribute
: A1(varchar(100)), I can use
: SELECT * FROM TABLE1 WHERE A1=somthing;
: if I try to select the records which have at least 3 words in A1, what's the
: SQL command?
: I tried
: SELECT * FROM TABLE1 WHERE A1 LIKE '% % %';
: but it does not work, anyone knows the answer?
: Actually it is a exercise in Ullman's book: database system: the complete
: book, Exercise 6.1.4 f).

r***e
发帖数: 31
3
Maybe I did not describe the problem clearly, the attribute A1 is a string,
how can I find all the records that have the value in A1 has the format "word1
word2 word3".

the

【在 s***e 的大作中提到】
: 做两次join吧
s***e
发帖数: 284
4
I see. Your query works in DB2.

【在 r***e 的大作中提到】
: Maybe I did not describe the problem clearly, the attribute A1 is a string,
: how can I find all the records that have the value in A1 has the format "word1
: word2 word3".
:
: the

1 (共1页)
进入Database版参与讨论
相关主题
SQL question: update a field请求SQL语句
请教set和select 的区别求助:如何ColumName 作为变量放入query
怎样快速得到两个表的交集问个SQL问题- partial outer join
请教一个SQL query该怎么写SQL combine two tables into one table and add a new column
[转载] 问个SQL问题SQL copy a table into a new table and add a new column
网站遭受Hack, 有哪位知道如何处理?新手请教SQL 语法问题- alias 和 join
Rookie's question againerror of executing SQL query of string concatenation (转载
SQL Server query 一问Is Oracle ODBC support batch SQL(PL/SQL procedure)?
相关话题的讨论汇总
话题: a1话题: sql话题: select话题: table1话题: where