-
04
-
11
-
2011
Kategorisi : Mysql
A harfi ile başlayan kayıtlar :
SELECT name FROM tablo WHERE name REGEXP '^A'
A,B,C harfi ile başlayan kayıtlar :
SELECT name FROM tablo WHERE name REGEXP '^(A|B|C)'
A harfi ile biten kayıtlar :
SELECT name FROM tablo WHERE name REGEXP 'P$'
Sadece rakamlar :
SELECT age FROM tablo WHERE age REGEXP '^[0-9]+$'
Kelime Ara :
SELECT name FROM tablo WHERE ornek REGEXP '[[:<:]]kelime[[:>:]]'
10 Basamaklı telefon numaraları :
SELECT name FROM tablo WHERE telefon_no REGEXP '^[0-9]{10}$'
-
03
-
11
-
2011
Kategorisi : Mysql
Mysql .’ ıncı satır gerekliyse ve tekrar ediyorsa :
select * from test where mod(id,10)=0;
-
05
-
10
-
2011
Kategorisi : Mysql,Php
function clear_sql( $data )
{
$bad = array("'","*","?","select","all","or","SELECT","ALL","OR","concat","-","+","(",")","union",",","group");
$good = array("_","_","_","_","_","_","_","_","_","_","_","_","_","_","_","_","_");
$result = str_replace($bad,$good,$data);
$result = trim(addslashes($result));
return $result;
}
print clear_sql($dt);
-
24
-
12
-
2010
Kategorisi : Mysql
ALTER TABLE tableName MODIFY tableNameID MEDIUMINT NOT NULL AUTO_INCREMENT;
-
24
-
12
-
2010
Kategorisi : Mysql
ALTER TABLE tableName ADD autoIncrementColumn MEDIUMINT NOT NULL AUTO_INCREMENT KEY
-
24
-
12
-
2010
Kategorisi : Mysql
update category set catname=concat(left(replace(catname,’y’,’Y’),1),substring(catname,2)) where catname like ‘y%’;
-
24
-
12
-
2010
Kategorisi : Mysql
UPDATE updatefrom p, updateto pp
SET pp.last_name = p.last_name
WHERE pp.visid = p.id
-
18
-
10
-
2010
Kategorisi : Linux,Mysql
Eğer,
Error: Connection to the database server has failed:
Table ‘mysql.servers’ doesn’t exist
türevi hatalar alıyorsanız:
mysql_upgrade -u admin -p your_password
komutu ile tabloları onarabilirsiniz.
-
29
-
08
-
2010
Kategorisi : Mysql
UPDATE updatefrom p, updateto pp
SET pp.last_name = p.last_name
WHERE pp.visid = p.id