mysql的查詢語句

2021-09-01    分類: 網(wǎng)站建設(shè)

mysql的查詢語句

查所有
select * from t5;
查一條數(shù)據(jù)
select *from t5 where id=9;
查符合條件數(shù)據(jù)對應(yīng)列的數(shù)據(jù)
select username from user where id=4;
給字段取別名
select username user form user;
select username as user from user;
-- distinct去除重復(fù)值 ,增加多個的時候,必須兩個同時不重覆才去除顯示
select distinct username,password form user;
查詢空值 null
select * from t1 where username is null;
select * from t1 where username is not null;
like的使用方法用來做搜索
like(包含)%PHP%包含php
select * from art where content like '%PHP%';

分享文章:mysql的查詢語句
網(wǎng)站網(wǎng)址:http://bm7419.com/news/124765.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供定制開發(fā)、網(wǎng)站內(nèi)鏈、定制網(wǎng)站、自適應(yīng)網(wǎng)站、做網(wǎng)站網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都網(wǎng)頁設(shè)計公司