Time of Update: 2015-04-23
標籤: 一.字串函數select concat(name,"age is",age) from users; insert(str,x,y,insert)//將字串x位置開始y個位置替換成insert select lower(str) upper(str)//轉化大小寫select * from user where upper(name)=‘AAA‘; left (str ,x)
Time of Update: 2015-04-24
標籤:1、首先pom.xml檔案裡面需要用到的jar配置: <!-- spring事務,包含了@Transactional標註 --><dependency><groupId>org.springframework</groupId><artifactId>spring-tx</artifactId><version>4.0.3.RELEASE</version></dependency>
Time of Update: 2015-04-23
標籤:檔案夾 電腦 而且 有時候,我們在安裝apache+php+mysql時,為了方便,就將已經在其他電腦上安裝好環境後的對應檔案夾(apache+php+mysql)拷貝到目標電腦上,這個時候一定要注意不僅要修改apache/conf/httpd.conf檔案,而且要修改php/php.ini檔案 我以 D:/haofeng/Apache2.
Time of Update: 2015-04-24
標籤:1.整形分為四種 tinyint smallint mediumint int bigint 注意: 右側的取值範圍是在未加unsigned關鍵字的情況下,如果加了unsigned,則最大值翻倍,如tinyint unsigned的取值範圍為(0~256)。項目出錯案例: 在做根據身份擷取城市的時候 發現大於127的region_id
Time of Update: 2015-04-24
標籤:mysql> show processlist;+----+------+-----------+------+---------+------+-------+------------------+| Id | User | Host | db | Command | Time | State |
Time of Update: 2015-04-24
標籤:mysql 數字輔助表 一個月所有天數 統計 procedure 1、問題如題目所說,通過MySQL擷取某年某月所有的天數。如擷取2014年2月的所有日期。2、處理過程2.1 建立一個數字輔助表CREATE TABLE `nums` ( `key` int(11) NOT NULL, PRIMARY KEY
Time of Update: 2015-04-22
標籤:/** * MySQL資料庫單例實現 * * @author shizqiang at 2015-04-22 * */final class MySQLFactory { private static $instance; private function __construct() {} public static function getInstance($server, $uname, $passwd, $dbname) {
Time of Update: 2015-04-23
標籤:1、使用索引來更快地遍曆表。 預設情況下建立的索引是非群集索引,但有時它並不是最佳的。在非群集索引下,資料在物理上隨機存放在資料頁上。合理的索引設計要建立在對各種查詢的分析和預測上。一般來說: a.有大量重複值、且經常有範圍查詢( > ,< ,> =,< =)和order by、group
Time of Update: 2015-04-23
標籤:在做C++項目時,經常會用到Mysql資料庫,Mysql介面提供給我們的資料是相當原始的,如:欄位名、欄位類型,欄位長度等等,一般情況我們都想一種更方便獲得資料如:XXXStruct* pRecourdInfo = (const
Time of Update: 2015-04-22
標籤:批量inserthttp://blog.csdn.net/xiaoxian8023/article/details/20155429 Mysql jdbc 批處理資料,需要給jdbc串連加上rewriteBatchedStatements=true。預設jdbc是不會開啟批處理。 例如:jdbc:mysql://10.250.4.98:3306/dbname rewriteBatchedStatements=true Java Upda
Time of Update: 2015-04-21
標籤:mysql 不連續的值 資料 select 1、問題有一個表資料如顯示。資料中,running_number應該是連續性的5位字元。現需要擷取到串連斷掉的running_number。如00001與00005間缺了00002,00003,00004。我們需要擷取到這三個running_number。2、解決方案2.1 獲得缺號前的臨界點值。select
Time of Update: 2015-04-23
標籤:mysql內建函數整理與使用 mysql內建函數整理 參考mysql官網:函數和操作符介紹時間和日期函數請參考:Mysql5.5官方文檔一般使用列舉1.查看系統當前日期調用日期函數即可mysql>select now(); mysql>select sysdate();mysql>select current_date();2.資料庫資訊查看mysql>select
Time of Update: 2015-04-20
標籤:mysql啟動多執行個體1、編譯安裝MySQL5.5# yum install -y cmake gcc gcc-c++ make cmake ncurses ncurses-devel# groupadd mysql# useradd -g mysql -s /sbin/nologin mysql#
Time of Update: 2015-04-22
標籤:percona pt-table-sync pt-table-checksum 目錄1、概述2、percona-tooldit工具的安裝3、建立使用者4、pt-table-checksum使用5、pt-table-sync使用6、個人總結1、概述
Time of Update: 2015-04-22
標籤:準備篇:1、配置防火牆,開啟80連接埠、3306連接埠vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT #允許80連接埠通過防火牆-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
Time of Update: 2015-04-20
標籤:MySQL索引分為普通索引、唯一性索引、全文索引、單列索引、多列索引等等。這裡將為大家介紹著幾種索引各自的用途。 一、 MySQL: 索引以B樹格式儲存 Memory儲存引擎可以選擇Hash或BTree索引,Hash索引只能用於=或<=>的等式比較。 1、普通索引:create index on Tablename(列的列表) alter table TableName add index (列的列表) create table TableName([
Time of Update: 2015-04-21
標籤:在開發項目的時候有個功能需要查看資料庫中有哪些表,以及每個表有哪些欄位,在網上查看了一下,現在分享給大家。Oracle: 查詢資料表(Tables)名稱:select Table_Name, Tablespace_Namefrom Dba_Tableswhere Tablespace_Name = ‘USERS‘; 查詢資料表(Tables)中的欄位(Columns)名稱:sql1:select column_name from all_tab_columns where
Time of Update: 2015-04-21
標籤:mysql初始化 mysql啟動報錯 初始化MySQL服務後,使用/etc/init.d/mysqld啟動MySQL服務,報錯,查看其錯誤記錄檔error.log:150413 21:26:54 mysqld_safe mysqld from pid file /data/mysqldata/mysql.pid ended150413 21:30:19 mysqld_safe Starting mysqld daemon
Time of Update: 2015-04-21
標籤:drop trigger IF EXISTS t_trigger;create trigger t_trigger before insert on aaa for each row begin INSERT INTO readandwrite_test.user(time) VALUES (NEW.timeline);end;/* INSERT:將新行插入表時啟用觸發程式,例如,通過INSERT、LOAD
Time of Update: 2015-04-21
標籤:JDBC(Java Data Base Connectivity,java資料庫連接)是一種用於執行SQL語句的Java API,可以為多種關聯式資料庫提供統一訪問,它由一組用Java語言編寫的類和介面組成。JDBC提供了一種基準,據此可以構建更進階的工具和介面,使資料庫開發人員能夠編寫資料庫應用程式。如果要使用資料庫就要添加資料庫的驅動,不同的資料庫有不用的驅動,這裡就不一一說明,添加jar程式驅動包的方法就不在這裡解釋,另一個文章裡面有介紹http://www.cnblogs.com/