mysql 其形怪句

2021-05-23 13:22:26 字數 545 閱讀 9824

1. select (select count(*) from world.city) - count(*) from world.city where id < 5;

2.select sum(if(color = 'blue',1,0)) as blue, sum(if(color = 'red',1,0)) as red from items;

3. select count(color = 'blue' or null) as blue, count(color='red' or null) as red from items;

4.  select film_id,description from sakila.film order by title limit 50,5;如果在大表的情況下,可以這樣優化

select film.film_id,film.description from sakila.film inner join (select film_id from sakila.film order by title limit 50,5) as lim using(film_id);

mysql常用句 mysql常用語句

select version 查詢mysql版本 use myblog 使用某資料庫 show tables 注釋,展示表 insert into users username,password realname values lisi 123 李四 插入語句,注意password關鍵字寫法 sel...

mysql簡單十句語句

mysql uusername ppassword show databases 顯示資料庫列表 use databasename 使用資料庫 show tables 顯示資料庫表 create database 資料庫名 cahrset 字符集 utf8 drop database 資料庫名 my...

OSG繪製空間凹多邊形並計算其面積

2.實現 3.參考 這個問題其實涉及到osg中的兩個問題 多邊形分格化和幾何圖元遍歷。在opengl osg中,由於效率的原因,預設是直接顯示的簡單的凸多邊形。如果直接強行顯示凹多邊形,渲染結果是不確定的。所以對於複雜的凹多邊形,需要將其分解成簡單的凸多邊形,這個過程就是多邊形分格化。在osg中是通...