'English ', 65 union all
Select N 'Li si', N 'physical ', 85
Go
-- 2000 method:
Dynamic:
Declare @ s nvarchar (4000)
Set @ s =''
Select @ s = @ s + ',' + quotename ([Course]) + '= max (case when [Course] =' + quotename ([Course], '''') + 'then [Score] else 0 end )'
From Class group by [Course]
Exec ('select [Student] '+ @ s +' from Class group by [Student] ')
Generate static:
Select
[Student],
[Mathematics] = max (case when [Course] = 'mate' then
disk space in the 'default' file group ", according to the error message, the size of the tempdb database file is less than 4 GB, and the size of the corresponding file is increased. The hard disk space is more than 40 GB, there should be no problem. Later, she said that the disk where the file is located is fat32, and the problem is that fat32 supports a maximum file size of 4 GB. Solution:
1. Restore Files in tempdb to the default value and set the maximum value.
1) restart the SQL server ser
: integer number (integer), decimal number (total length, decimal place), write only number, indicating no limit.Date: date type, which can be saved as year, month, day, hour, minute, and second.
Q: Why is the string type varchar2 in Oracle related to varchar?Answer:In Oracle, varchar has been used as a reserved word. If you use the varchar type, Oracle will not report an error, but after creating the table, you will find that it has automatically changed to the varchar2 type.
Q: Do I use number
table my_test_bad Structure
Desc my_test_bad
Name Type Nullable Default Comments
----------------------------------------------------
ORA_ERR_NUMBER $ NUMBER Y
ORA_ERR_MESG $ VARCHAR2 (2000) Y
ORA_ERR_ROWID $ UROWID (4000) Y
ORA_ERR_OPTYP $ VARCHAR2 (2) Y
ORA_ERR_TAG $ VARCHAR2 (2000) Y
SID VARCHAR2 (4000) Y
NAME VARCHAR2 (4000) Y
GENDER VARCHAR2 (
intoreplace into table (id, name) values ('1', 'A'), ('2', 'bb ')
This statement inserts two records into the table.
2. replace (object, search, replace)
Replace all search objects with replaceselect replace ('www .163.com ', 'w', 'ww')-> www wWw.163.com
For example, replace aa in the name field of the table with bbupdate table set name = replace (name, 'AA', 'bb ')Replace text or ntext fields in SQL Server
At the beginning, the Update AA table Set xx field = Replace (xx field, "to Replace",
to 4000, and the set ID is the primary key, resulting in an errorOrg.apache.hadoop.hive.ql.stats.jdbc.JDBCStatsSetupConstantsMySQL-65535, SQL Server-8000, Oracle-4000, Derby-32762, Postgres-large. public static final int id_column_varchar_size = 4000;Org.apache.hadoop.hive.ql.stats.jdbc.JDBCStatsPublisher:public boolean init (Configuration hconf)if (Colsize From
Oracle DML Error Log (Note), oracledml
DML error log is an error log function introduced by oracle10gR2 similar to SQL * Loader. The basic principle is to transfer any records that may cause statement failure to an error log table.
The specific usage is as follows:
1. Use DBMS_ERRLOG.CREATE_ERROR_LOG to create an error log table.
-- Original table my_test table structure desc my_test Name Type Nullable Default Comments ------ ------------ ------- -------- sid number name VARCHAR2 (20) y gender i
invalid. Update article set heading = Replace (convert (nvarchar (4000), heading), 'script, script ', '')
1
Update table name
2
Set text field name = replace (convert (varchar (8000), text field name), 'replacement character ', 'Replacement to value ')
Varchar and nvarchar support replace, so if your text/ntext cannot exceed 8000/4000, you can convert it to the first two types before using replace.
1
Updat
Createtypechar_tableistableofvarchar2 (4000); -- create a custom type script createorreplacefunctionsplit_string (pi_strin
Create type char_table is table of varchar2 (4000); -- create a custom type script create or replace function split_string (pi_str in
Create type char_table is table of varchar2 (4000); -- create a custom type script
Create or replace fu
nvarchar (4000)
Set @ s =''
Select @ s = @ s + ',' + quotename ([course]) + '= max (case when [course] =' + quotename ([course], '''') + 'then [score] else 0 end )'
From class group by [course]
Exec ('select [Student] '+ @ s +' from class group by [Student] ')
Generate static:
Select
[Student],
[Mathematics] = max (case when [course] = 'mate' then [score] else0End ),
[Physical] = max (case when [course] = 'physical 'Then [sc
recommended to print the @sql\ @CMD variables before execution.4. This issue can be used as an archiving scheme. Recommended reference for my blog:SQL Server Data Archiving Scenariosetnocounton;--Define Variables DECLARE @FullTableName nvarchar ( ) -- Full table name NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP, @BulkInsertFolder nvarchar (4000) --Data Catalog NBSP, @ArchiveFolder nvarchar (4000)
See Code annotations for application notes.1. Simple Search Examples show: public void Search () throws IOException {//Custom cluster node name String clustername = "elasticsearch_pudongping"; Get Client clients = Esclient.initclient (clustername); Create a query index, the parameter Productindex represents the index library to query for Productindex searchrequestbuilder searchrequestbuilder = client. P Reparesearch ("Productindex"); Set the query index type, settypes ("P
VALUEFROM all_objectsWHERE rownum
-- Create a unique indexCreate unique index unq_a ON a (id );
-- Use the system package to create the corresponding error log table
EXEC DBMS_ERRLOG.create_error_log (dml_table_name => 'A', err_log_table_name => 'A _ log ');
PL/SQL procedure successfully completed.
SQL> desc A_LOGName Null? Type----------------------------------------------ORA_ERR_NUMBER $ NUMBER -- NUMBER of error recordsORA_ERR_MESG $ VARCHAR2 (2000) -- error messageORA_ERR_ROWID $ ROWID --
bytes, that is, English characters are also expressed in two bytes. The length of nchar and nvarchar is between 1 and 4000. Compared with char and varchar,Nchar and nvarchar can store a maximum of 4000 characters, both in English and Chinese. char and varchar can store up to 8000 English and 4000 Chinese characters.. It can be seen that when using nchar and nvar
The undo mechanism is a clever feature of Oracle and one of the difficulties in learning oracle.
Next we will learn more about it internally.
Session 1: Scott user, initiates a transaction
hr@ORCL> conn scott/oracleConnected.scott@ORCL> UPDATE emp SET sal=4000 WHERE empno=7788;1 row updated.scott@ORCL> SELECT empno,ename,job,mgr,sal FROM emp WHERE empno=7788; EMPNO ENAME JOB MGR SAL---------- ---------- --------- ---------
-- Exchange of rows and columns/*************************************** **************************************** **************************************** *******************************Take student scores as an example, which is easy to understand
Organized by: Roy)
Date: 2008.06.06**************************************** **************************************** **************************************** ******************************/
-- 1. Columns of rows--> (Roy) generate a sequence numberIf no
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.