sql Óï¾ä×ܽá
mysql : ½«Ò»¸ö±íµÄÊý¾Ý²åÈëµ½newT ÖÐ
£¨newT ±íÐë´æÔÚ£¬ÇҽṹÓëselect Óï¾ä¶ÔÓ¦µÄ½á¹¹Í¬ £¬×îºÃ²»ÓÃ* ¶øÊǾßÌå×ֶΣ©
insert into newT select * from t1 where ...
Ò²¿ÉÒÔcreate table newT select f1,f2 from t1; (select into µÄÌæ´ú·½·¨£¬mysql ²»Ö§³Öselect into )
MySQL²»Ö§³ÖSelect Into
database table µÄ±¸·Ý
mysqldump -uroot -proot -h192.101.111.111 databaseName [tableName] >a.sql
Éú³É±í½á¹¹¼°ÀïÃæµÄËùÓÐÊý¾Ý
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
¿ÉÒÔÓÃÏÂÁÐÓï¾ä
source a.sql ÖØÐµ¼Èë
µ±È»µ¼Èë֮ǰ¿ÉÒÔÐÞ¸Äa.sql ÀïµÄÄÚÈÝ£¬Èç±íÃû£¬Èç´Ë¿ÉʵÏÖ±¸·Ý
½«Êý¾Ý±¸·Ý£¬£¨²»Êǵ¼³ösql Óï¾ä£¬¶øÖ»µ¼³ö ÆäÖÐ µÄÊý¾Ý£©
select * into outfile 'c:\out.txt' from tableName where ...;
¶ÔÓ¦µÄµ¼È룺
load data local infile 'c:\out.txt' into table positiondata fileds terminated by ';' (userid ,username );
Ïà¹ØÎĵµ£º
²éÑ¯ÖØ¸´Öµ£¬ÏÔʾ³ö²»Öظ´µÄ²¿·Ö
select distinct(employeeid) from orders
²éѯÁ½¸ö±íÖ®¼äÏàͬÊý¾Ý
select orders.EmployeeID,Employees.EmployeeID
from orders INNER JOIN Employees
on Employees.EmployeeID=orders.EmployeeID
ʵÏÖÄ¿µÄ£¬Ò»¸ö±í´æ·ÅÓû§±àºÅºÍÓû§Ãû£¬ÔÚÁíÒ»¸ö±íÖпÉÒÔ¸ù¾ÝÓû§±àº ......
SqlCommand com = new SqlCommand("select * from myuser where username=@UserName and password=@Pwd", con);
com.Parameters.Add(new SqlParameter("@UserN ......
Aaron Bertrand
Adam Machanic
All Things SQL Server
Allen Kinsel - SQL DBA
Allen White
Amit Bansal writes...
Andrew Fryer's Blog
Andrew Kelly
Andy Leonard
Anything and Everything IT
Arcane Code
Arnie Rowland: Ramblings of a Harried Technogeek
B.I. for the SQL Guy
Bart Duncan's SQL Weblog ......
import java.sql.*;
public class JdbcUtil
{
public static void close(Statement st, Connection con)
{
try
{
&nb ......
ºÜ¶àÈËÌØ±ðϲ»¶ÓÃÊÓͼ,µ«ÓеÄÈË´ÓÀ´²»ÓÃÊÓͼ.Õâ¶¼ÊÇÁ½ÖÖ²»Á¼µÄϰ¹ß. ÒªÃ÷È·ÊÓͼ¿ÉÒÔÍê³ÉµÄ¹¤×÷ÒÔ¼°Ê¹Óó¡ºÏ.
1.×èֹѡÔñ±£ÃÜÁÐ
2.½µµÍÓû§¶ÁÈ¡Êý¾Ý¿âÄÚÊý¾ÝµÄ¸´ÔÓÐÔ
3.ÔÚÊý¾Ý¿âÖÐÌí¼ÓË÷ÒýÒÔ¼ÓËÙ ......