No......Even if you delete all the records, you can use data recovery tools to retrieve them.Even if you cover n times with professional tools to make sure the data can't be recovered, the Web site also has a memory of which IP has visited what time. Then run the ISP (Unicom or telecommunications) a check, xx time xx IP to whom?I'll pull you out in minutes.Even, it has been reported before, using big data, only a few behavioral characteristics, you can identify the user identity.It is enough to
If there are two tables (a, B), table A has four fields: A, B, C, and D. Table B only has three fields: A, B, and C, if I want to merge the contents of Table B into Table A, but there is. A = B. in case of a, a is the primary key and repeated values are not allowed. how to do this.
Insert into a select *, null from B where not exists (select 1 from a where a. A = B.),Only 1 is returned, and * can be us
Mybatis dynamically transfers table names (also applies to dynamically transfers table fields) and mybatis Fields
// Set the name of the map parameter, innerTable, and outTable.
Public String sendDetail (){Pager = getStartPager ();If (null! = Msg msg. equals ("succ ")){Map. put ("innerTable", "bs_sent_inner ");Map. put ("outTable", "bs_sent_out ");Pager = outBoxInnerService. findSendPager (pager, map );}If
(COLUMNPROPERTY (a. id, a. name, 'Scale'), 0) as N 'decimal ',(Case when a. isnullable = 1 then '√ 'else' 'end) n' allow null ',Isnull (e. text, '') n' default value ',Isnull (g. [value], '') AS n' field description'-- Into # txFROM syscolumns a left join policypes BOn a. xtype = B. xusertypeInner join sysobjects dOn a. id = d. id and d. xtype = 'U' and d. name Left join syscomments eOn a. cdefault = e. idLeft join sys. extended_properties gOn a. id = g. major_id AND a. colid = g. minor_idOrder
UPDATE statement: the statement that updates the fields in one table to the fields in another table adds a field to a table in one table in the modification of the result query system, now we need to copy the corresponding ID of another table. because such SQL operations are not often used, we even think of writing a loop for processing. However, I thought that SQL should be able to implement such a functio
1. Normal Value of json data: json [I]. fieldName
2. json data fields contain spaces: eval ('json ['+ I +'] ["'+ field +'"] ')
3. json Data assignment: eval ('json ['+ I +'] ["'+ field +'"] = '+ jsonFilter. length );
4. Add fields to json data: loop all data and directly use json [I]. newField = defaultValue.
5. Sorting of json data: equivalent to sorting of arrays. json. sort (function (a, B) {return a
Auto-increment of fields created in oracle -- two implementation methods are summarized: oracle Fields
Mysql and other databases have the function of Automatically increasing table IDs with the insertion of records, while oracle does not. We have the followingTwo TypesThis method can solve the field auto-increment function.
Because both methods need to be implemented by creating sequences, we will first pro
1. Log in to the database>mysql-u root-p Database name2. Querying all data Sheets>show tables;3. Querying the table for field information>DESC table name;4.1 Adding a table fieldALTER TABLE table1 add transactor varchar (ten) not Null;ALTER TABLE table1 add ID int unsigned not Null auto_increment primary key4.2. Modify the field type of a table and specify null or non-empty>alter Table name change field name segment type [whether non-null allowed];>alter Table name Modify field type [whether non
= Directory.GetFiles (EP, "Tmpsourcefile.*");foreach (String fl in FLs)File.delete (FL);}Catch {}Try{String pf = EP + "Tmpsourcefile." +HZM;FileStream stream = new FileStream (PF, filemode.createnew, FileAccess.Write);BinaryWriter bw = new BinaryWriter (stream);Bw. Write (data);Bw. Close ();Stream. Close ();Thread.Sleep (100);Process proc = new process ();Proc. Startinfo.filename = PF;Proc. Startinfo.arguments = "";Proc. Start ();}Catch {}}CLOB, Blob is Oracle two special field type size limit
Tags: object scons cts and select default value NULL log alter1. Modify the field name:ALTER TABLE name rename column A to B2. Modify the field type:ALTER TABLE name ALTER COLUMN field name type NOT NULL3. Modify the field default valueALTER TABLE name add default (0) for field name with valuesIf the field has a default value, you need to remove the constraint for the field before adding a new default value,Select C.name from Sysconstraints aINNER JOIN syscolumns B on a.colid=b.colidINNER JOIN s
the following SQL statement: (here I use the Discuz to do the demo)
The code is as follows
Copy Code
UPDATE ' pre_forum_post ' SET ' author ' = replace (' author ', ' Xiang Lei tribe ', ' Xiang Lei ')
It means to change the user name "Xiang Lei tribe" to "Xiang Lei", where pre_ to modify the table prefix for your own database.
The code is as follows
Copy Code
UPDATE phpcms_article SET title=replace (title, ' [200
Queries whether all tables in the specified database contain specified fields and database fields.
Today, we encountered a problem: to update the values of a field in the database in batches, we need to first find the tables that contain this field, and sort out the following statements to facilitate query.
SELECT DISTINCTT. table_name,C. COLUMN_NAMEFROMInformation_schema.TABLES tInner join information_sc
1. Normal Value of json data: json [I]. fieldName2. json data fields contain spaces: eval ('json ['+ I +'] ["'+ field +'"] ')3. json Data assignment: eval ('json ['+ I +'] ["'+ field +'"] = '+ jsonFilter. length );4. Add fields to json data: loop all data and directly use json [I]. newField = defaultValue.5. Sorting of json data: equivalent to sorting of arrays. json. sort (function (a, B) {return a [name]>
(a. id, a. name, 'Scale'), 0) as N 'decimal ',(Case when a. isnullable = 1 then '√ 'else' 'end) n' allow null ',Isnull (e. text, '') n' default value ',Isnull (g. [value], '') AS n' field description'-- Into # txFROM syscolumns a left join policypes BOn a. xtype = B. xusertypeInner join sysobjects dOn a. id = d. id and d. xtype = 'U' and d. name Left join syscomments eOn a. cdefault = e. idLeft join sys. extended_properties gOn a. id = g. major_id AND a. colid = g. minor_idOrder by object_name
Syntax for adding fields: alter table tablename add (column datatype [default value] [null/not null],...);
Alter table tablename modify (column datatype [default value] [null/not null],...);
Syntax for deleting a field: alter table tablename drop (column );
Multiple columns are separated by commas.
Use alter table to add, delete, and modify a column.
Create a table structure:Create table test1(Id varchar2 (20) not null );
Add a field:Copy codeThe Code
Add new fields (columns) and MYSQL fields to the existing tables in the mysql database.
-- Note: MYSQL has never been used recently because of the need for projects. Although it is used by small and medium-sized enterprises and network companies, it is mainly used across platforms and has a low purchase cost, upgraded to open-source. Therefore, it occupies most of the market share.
Alter table 'database n
Obtain database table fields and database fields
SELECT
Table name = case when a. colorder = 1 then d. name else ''end,
Table description = case when a. colorder = 1 then isnull (f. value, '') else'' end,
FIELD No. = a. colorder,
Field name = a. name,
Id = case when COLUMNPROPERTY (a. id, a. name, 'isidentity ') = 1 then' √ 'else' end,
Primary Key = case when exists (SELECT 1 FROM sysobjects where xtype = '
1. Normal Value of json data: json [I]. fieldName
2. json data fields contain spaces: eval ('json ['+ I +'] ["'+ field +'"] ')
3. json Data assignment: eval ('json ['+ I +'] ["'+ field +'"] = '+ jsonFilter. length );
4. Add fields to json data: loop all data and directly use json [I]. newField = defaultValue.
5. Sorting of json data: equivalent to sorting of arrays. json. sort (function (a, B) {return
The difference between static final string Hello = "hello" and static string Hello = "hello" has never been quite clear. The following is an example:
Public class constclass {static {system. Out. println ("const class Init! ");} // Public static string Hello =" hello "; (1) // public static final string Hello =" hello "; (2 )}
Public class notinitexample {public static void main (string [] ARGs) {system. Out. println (constclass. Hello );}}
If run (1), the output result is
Const class In
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.