Category: SQL

SQL multi-table join queries

inner join, full outer join, left join, right jion A combination of internally connected inner join two tables are met full outer whole company, the same combination of the two tables together in Table A, Table B data (null), the same table B A table does not display (null) Table A left join B table […]

Sqlserver Store null values ??to the database

If, as stored in the database null value or null, then he stored in the database will be stored in what form, if you want to remove this value from the database, then his whole value will show in what form. On this question when I do a project, I like the database stored in “value, […]

usage of access like!!

Access do a fuzzy query always can not find the data, but the SQL statement on access can query data. The SQL statement is this: Electric Division SELECT count (cash) FROM student WHERE banji = ‘5010 ‘and computer like’ * two * ‘and final = 1; Tangled really bad, and why! ! “*” Represents obviously match 0 or […]

oracle compression exemplar space

How does it work table compression In 2nd edition Orcle9i table compression characteristics delete duplicate data values ??found in the database table to save space. Compression level of the database data blocks. When it is determined that a table to be compressed, the database space is reserved in the data block in each database in order to […]

Digest SQL statements collected

: SQL code — min server memory EXEC sp_configure N‘min server memory (MB)’, 0 — max server memory EXEC sp_configure N‘max server memory (MB)’, 256 — RECONFIGURE WITH OVERRIDE .sql: SQL code /*–     SQL Server 2000 MyDB      1?31     ALTER DATABASE?     ???     ? –*/ — master USE master GO –A.  MyDB CREATE DATABASE MyDB ON PRIMARY                           —   ( NAME=‘MyDB_Primary’,    FILENAME= ‘c:/MyDB_Prm.mdf’), FILEGROUP MyDB_FG1                   –1   ( NAME = ‘MyDB_FG1_Dat1’,    FILENAME = ‘c:/MyDB_FG1_1.ndf’),  –1   ( NAME = ‘MyDB_FG1_Dat2’,    FILENAME = ‘d:/MyDB_FG1_2.ndf’),  –2 FILEGROUP MyDB_FG2                   –2   ( NAME = ‘MyDB_FG1_Dat’,    FILENAME = ‘e:/MyDB_FG2.ndf’)     — LOG ON                               —   ( NAME=‘MyDB_log’,    FILENAME =‘d:/MyDB.ldf’) GO –B. ALTER DATABASE MyDB MODIFY FILEGROUP MyDB_FG1 DEFAULT GO — MyDB USE MyDB –C. MyDB_FG1,MMyDB_FG2 CREATE TABLE MyTable   ( cola   int   PRIMARY KEY ,     colb   char(8) ,     colc   image )     TEXTIMAGE_ON MyDB_FG2 –MyDB_FG2 CREATE INDEX IX_MyTable ON MyTable(cola) ON MyDB_FG2 GO –D. MyDB_FG1_Dat1?MyDB_FG1_Dat1 DBCC SHRINKFILE(MyDB_FG1_Dat1,EMPTYFILE) –MyDB_FG1_Dat1 ALTER DATABASE MyDB REMOVE FILE MyDB_FG1_Dat1 […]

oracle 10G flashback learning

Project development, the front desk staff does not accidentally delete the configuration table data, I use this method to restore the deleted data, follow these steps  – First start mobile  alter table table_name enable row movement;  – Point in time recovery (in this case based only on point-in-time recovery, and another scn recovery after introduction)  […]

Ordinary ranks conversion of the SQL statement

Suppose Zhang Xuesheng results table (tb_rowtocol) follows Name Subject Result Joe Smith Language 73 Joe Smith Mathematics 83 Joe Smith Physics 93 John Doe Language 74 The John Doe Mathematics 84 The John Doe physical 94 Want to become Name the language of mathematical physics Joe Smith 738 393 John Doe 748 494 DECLARE @ […]

oracle composite partition operation

– Create and modify sub-partition method (range-list) select partition_name, subpartition_name, tablespace_name from user_tab_subpartitions where table_name = ‘TM_CI_USER_SALARY_M1’; – Relevant query primary partition table and sub-partition table all_tab_partitions all_tab_subpartitions – Examples of operations create table scott.TM_CI_USER_SALARY_M1 is ( statis_month number (6), area_code varchar (4), empno number (4), ename varchar2 (10), job varchar2 (9) The Mgr number […]

The usual collection of known point

1, RegisterStartupScript usage, ClientScript.RegisterStartupScript (this.GetType (), “MyKey1234”, “<script type=’text/javascript’ defer=’defer’> AddMoreRow (‘” + Request [“ProuductionNums”]. ToString () + “‘, ‘ ‘, ‘0, 0,0,0’); </ script> “, false); Js add properties, property document.getElementById (‘test’). setAttribute (‘title’, ‘now / nchanged’); this.getAttribute (‘msgtitle’) Js in the server-side variable var vpInsuranceOption = “<% = pInsuranceOption%>”; note the double quotes […]