在SQL中如果是
use pubs
go
select * from titles where title_id = 'BU1032'
这个里面等号是用来做为赋值的title_id就等于 BU1032
在
select '成本价'=price-price*03 from titles
这个里面=号也可以算是为赋值,虽然是用来做列名
可是
select titles.title_id,au_fname
from titles,authors,titleauthor
where titleauthor.au_id = authors.au_id and titles.title_id = titleauthor.title_id
里面的=号的意义是什么呢?authors.au_id 原本只有23行数据 titleauthor.au_id原本有25行数据 titles.title_id只有18行数据但是这条语句执行完以后出来的数据却是25条他到底是怎么组合的?求教!
...全文
12115打赏收藏
关于SQL中=号的讨论
在SQL中如果是 use pubs go select * from titles where title_id = 'BU1032' 这个里面等号是用来做为赋值的title_id就等于 BU1032 在 select '成本价'=price-price*03 from titles 这个里面=号也可以算是为赋值,虽然是用来做列名 可是 select titles.title_id,au_fname from titles,authors,titleauthor where titleautho
[Quote=引用楼主 wzy4850 的帖子:]
在SQL中如果是
use pubs
go
select * from titles where title_id = 'BU1032'
这个里面等号是用来做为赋值的title_id就等于 BU1032
在
select '成本价'=price-price*03 from titles
这个里面=号也可以算是为赋值,虽然是用来做列名
可是
select titles.title_id,au_fname
from titles,authors,titleauthor
where titleauthor.au_id = authors.au_id and titles.title_id = titleauthor.title_id
里面的…
[/Quote]
select * from titles where title_id = 'BU1032' 这句的意思是 “帮我找出所有title_id等于BU1032的行”,你英语很差吧。Where 后面的不是赋值,是查找条件,"当...的时候"