%-------通配符
select * from [EMoney_Club].[dbo].[GoldIdea_AdviceCollect] where [Content] like '%昵称%'
select * from [EMoney_Club].[dbo].[GoldIdea_AdviceCollect] where [Content] like '昵称%'----昵称开头
"_"-------通配符(单独一个字符)
select * from [EMoney_Club].[dbo].[GoldIdea_AdviceCollect] where [TopicId] like '17_'
"_"--------代替多个字符
SELECT * FROM FRIENDS WHERE PHONE LIKE ‘555-6_6_'
SELECT NAME FROM SOFTBALL
UNION
SELECT NAME FROM FOOTBALL
----合并两张表,去重显示
----合并两张表,去重显示
SELECT NAME FROM SOFTBALL
UNION ALL
SELECT NAME FROM FOOTBALL
---合并两张表,并显示所有
intersect --相交
SELECT * FROM FOOTBALL
INTERSECT
SELECT * FROM SOFTBALL
INTERSECT
SELECT * FROM SOFTBALL
minus--相减(存在第一张表但不存在第二张表的记录)
SELECT * FROM FOOTBALL
SELECT * FROM FOOTBALL
MINUS
SELECT * FROM SOFTBALL
in (between) --从属运算(between 某一个范围内 in在其中一个)
in (between) --从属运算(between 某一个范围内 in在其中一个)
SELECT * FROM FRIENDS WHERE STATE= 'CA' OR STATE ='CO' OR STATE ='LA'
SELECT * FROM FRIENDS WHERE STATE IN('CA','CO','LA')
SELECT * FROM PRICE WHERE WHOLESALE BETWEEN 0.25 AND 0.75