select * from pet;
insert into pet values('Liujingwei','Liuchao','cat','f','1984-04-18',null);
UPDATE pet set birth='1989-08-31' WHERE name='Slim';
select * from pet WHERE birth>'1998-1-1';
SELECT * from pet WHEREselect * from pet;
insert into pet values('Liujingwei','Liuchao','cat','f','1984-04-18',null);
UPDATE pet set birth='1989-08-31' WHERE name='Slim';
select * from pet WHERE birth>'1998-1-1';
SELECT * from pet WHERE species='dog' and sex='f';
select * from pet WHERE species='snake' or species='cat';
SELECT * from pet WHERE (species='cat' and sex='m') or (species='dog' and sex='f');
SELECT name,birth from pet;
SELECT owner from pet;
SELECT distinct owner from pet;
SELECT name,species,birth from pet where species='dog' or species='cat';
=======================================================================
select name,birth from pet ORDER BY birth;
select name,birth from pet order by birth desc;
select name,species,birth from pet order by species,birth desc;
========================================================================
select name,birth,curdate(),(year(curdate())-year(birth))-(right(curdate(),5)<right(birth,5)) as age from pet order by name;
select name,birth,curdate(),(year(curdate())-year(birth))-(right(curdate(),5)<right(birth,5)) as age from pet order by age;
select name,birth,curdate(),(year(curdate())-year(birth))-(right(curdate(),5)<right(birth,5)) as age from pet WHERE death IS NOT NULL ORDER BY age;
select name,birth ,month(birth) from pet;
SELECT name, birth from pet WHERE MONTH(birth) = 5;
SELECT name, birth from pet WHERE MONTH(birth) = MONTH(DATE_ADD(CURDATE(),INTERVAL 1 MONTH));
SELECT name, birth from pet WHERE MONTH(birth) = MOD(MONTH(CURDATE()), 12) + 1;
select 1 is null,1 is not null;
select 0 is null, 0 is not null,'' is null,'' is not null;
SELECT * from pet WHERE name LIKE 'b%';
SELECT * from pet WHERE name LIKE '%fy';
SELECT * from pet WHERE name LIKE '%w%';
SELEC
1. Ö±½ÓÔÚPL/SQL ÖÐÐÞ¸ÄÊý¾Ý
selectÓï¾äºóÃæ¼Ó‘for updata’£¬´ò¿ª½çÃæÉϵÄÐ¡Ëø£¬±à¼£¬°´¹³¹³±£´æ¡£
eg: select * from xtgldxsyncdw for update; ²éѯ½á¹û´°¿ÚµÄÐ¡Ëø¼´¿É´ò¿ª¡£
2. µ¼È˵¼³ötables
tools -->import ......
¸ÕÅöµ½Õâ¸öÎÊÌâʱ£¬ÒÔΪÊÇÓ¦Ó÷þÎñÆ÷ºÍÊý¾Ý¿â·þÎñÆ÷ûÁ¬Í¨£¬²éÁ˰ëÌìµÄÍøÂç½á¹ûÍøÉÏÒ»²é£¬¸úSQL Server 2005Óйأ¬ÄãÌ«ÑôµÄ£¡
¿ªÊ¼²Ëµ¥-SQLServer2005-ÅäÖù¤¾ß-SQL Server Configuration Manager-SQLserver2005ÍøÂçÅäÖÃ-MSSQLSERVERµÄÐÒé-Ë«»÷TCP/IPÐÒé
°ÑIP¸Ä³Éµ±Ç°Ê¹Óõ쬵±È»£¬¶Ë¿ÚҲҪȷ±£ ......