看板Programming
標 題Re: [問題] sql的min
發信站交大資科_BBS (Tue Jun 20 00:09:23 2006)
轉信站ptt!ctu-reader!ctu-peer!news.nctu!netnews.csie.nctu!news.ee.ttu!news.c
==> 在 [email protected] (沒有怎麼辦) 的文章中提到:
> 我找到一種寫法
> select student, score
> from t
> where score=(
> select min(score)
> from t
> )
> 但是對於這種寫法,因為我的t其實是另一個很長的子句
> 上面這種寫法有兩個一樣的t 程式變得非常醜...
若 t 很常用, 又嫌它醜的話,
就把它作成一個 view 吧.
--
* Origin: ★ 交通大學資訊科學系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>