¾µäsqlÓï¾ä£¬ÊµÏÖÁËÐ޸ģ¬Ôö¼Ó£¬É¾³ý£¬Åжϱí×Ö¶Î
create database test1
use test1
create table admin
(
id int primary key ,
name varchar(50),
pwd varchar(50),
)
insert into admin values(1,'aa','aa')
alter table admin add tel varchar(50) NULL
select * from admin
select * from admin
if exists (select * from syscolumns where id=object_id('admin') and name='mms') print 'ÒѾ´æÔÚ¸Ã×Ö¶Î'
alter table admin add tel varchar(50) NULL
alter table admin alter column name set bbs varchar(50) null
alter table tablename drop column oldfield
EXEC sp_rename 'admin.sss', 'tel', 'COLUMN'
Ïà¹ØÎĵµ£º
ÎÒÃÇÒª×öµ½²»µ«»áдSQL,»¹Òª×öµ½Ð´³öÐÔÄÜÓÅÁ¼µÄSQL,ÒÔÏÂΪ±ÊÕßѧϰ¡¢ÕªÂ¼¡¢²¢»ã×ܲ¿·Ö×ÊÁÏÓë´ó¼Ò·ÖÏí£¡
£¨1£©Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
orACLEµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ ......
×öÊý¾Ý¿â¿ª·¢»ò¹ÜÀíµÄÈ˾³£Òª´´½¨´óÁ¿µÄ²âÊÔÊý¾Ý£¬¶¯²»¶¯¾ÍÐèÒªÉÏÍòÌõ£¬Èç¹ûÒ»ÌõÒ»ÌõµÄ¼È룬ÄÇ»áÀË·Ñ´óÁ¿µÄʱ¼ä£¬±¾ÎĽéÉÜÁËOracleÖÐÈçºÎͨ¹ýÒ»ÌõSQL¿ìËÙÉú³É´óÁ¿µÄ²âÊÔÊý¾ÝµÄ·½·¨¡£
²úÉú²âÊÔÊý¾ÝµÄSQLÈçÏ£º
SQL> select rownum as id,
2 &nb ......
¡¡SQLÖÐÓÐËÄÖÖ»ù±¾µÄDML²Ù×÷£ºINSERT£¬SELECT£¬UPDATEºÍDELETE¡£
INSERTÓï¾ä
¡¡¡¡Óû§¿ÉÒÔÓÃINSERTÓï¾ä½«Ò»ÐмǼ²åÈëµ½Ö¸¶¨µÄÒ»¸ö±íÖС£ÀýÈ磬Ҫ½«¹ÍÔ±John SmithµÄ¼Ç¼²åÈëµ½±¾ÀýµÄ±íÖУ¬¿ÉÒÔʹÓÃÈçÏÂÓï¾ä£º
¡¡¡¡INSERT INTO EMPLOYEES VALUES
¡¡¡¡ ('Smith','John','1980-06-10',
¡¡¡¡ 'Los Angles',16,45000);
¡¡ ......
Î壺 ORACLEµÄÖ´Ðмƻ®
±³¾°ÖªÊ¶£ºÎªÁ˸üºÃµÄ½øÐÐÏÂÃæµÄÄÚÈÝÎÒÃDZØÐëÁ˽âһЩ¸ÅÄîÐÔµÄÊõÓ
¹²ÏísqlÓï¾ä
ΪÁ˲»Öظ´½âÎöÏàͬµÄSQLÓï¾ä(ÒòΪ½âÎö²Ù×÷±È½Ï·Ñ×ÊÔ´£¬»áµ¼ÖÂÐÔÄÜϽµ)£¬ÔÚµÚÒ»´Î½âÎöÖ®ºó£¬ORACLE½«SQLÓï¾ä¼°½âÎöºóµÃµ½µÄÖ´Ðмƻ®´æ·ÅÔÚÄÚ´æÖС£Õâ¿éλÓÚϵͳȫ¾ÖÇøÓòSGA(system global are ......
SQL
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
1.<sql:setDataSource>
ÉèÖÃÊý¾ÝÔ´
<sql:setDataSource dataSource=""|url="jdbcUrl" driver="" user="" password=""
var="varName" scope=""/>
var:String DataSource
dataSourceµÄÖµÓÐÁ½ÖÖÐÎʽ£º1.Ö¸¶¨Êý¾ÝÔ´µÄJ ......