資料庫操作

2021-07-04 03:50:08 字數 606 閱讀 2331

mysql資料庫

日期和字元相互轉換

date_format(date,'%y-%m-%d') -------------->oracle中的to_char(); 

str_to_date(date,'%y-%m-%d') -------------->oracle中的to_date(); 

%y:代表4位的年份 

%y:代表2為的年份 

%m:代表月, 格式為(01……12)  

%c:代表月, 格式為(1……12) 

%d:代表月份中的天數,格式為(00……31)  

%e:代表月份中的天數, 格式為(0……31) 

%h:代表小時,格式為(00……23)  

%k:代表 小時,格式為(0……23)  

%h: 代表小時,格式為(01……12)  

%i: 代表小時,格式為(01……12)  

%l :代表小時,格式為(1……12) 

%i: 代表分鐘, 格式為(00……59)  

%r:代表 時間,格式為12 小時(hh:mm:ss [ap]m)  

%t:代表 時間,格式為24 小時(hh:mm:ss) 

資料庫(庫操作)

information schema 虛擬庫,不占用磁碟空間,儲存的是資料庫啟動後的一些引數,如使用者表資訊 列資訊 許可權資訊 字元資訊等 performance schema mysql 5.5開始新增乙個資料庫 主要用於收集資料庫伺服器效能引數,記錄處理查詢請求時發生的各種事件 鎖等現象 my...

資料庫 資料庫基本操作

操作練習 修改表結構 表資料的操作 實現 1 建立表 create table student stu no char 12 not null primary key,stu name varchar 20 not null gender tinyint 1 default1,age tinyint...

資料庫操作

第乙個問題 通常用datareader對像 sqlcommand comm new sqlcommand select count from login where name textbox1.text and password textbox2.text,conn datareader dr co...