SQL Server 2005 SELECTd.name N'TableName', D.xtype N'Tabletype', A.colorder N'columnindex', A.name N'ColumnName', ( Case when ColumnProperty(A.id,a.name,'isidentity')=1 Then '1'Else '0' End) N'IDNETITYFG', ( Case when(SELECT Count(*)
Database query name:
SelectName from Master. DBO. sysdatabasesWhere status<> 512
Query table (tables) Name:
SelectName from DBO. sysobjectsWhere objectproperty (ID, n'isusertable ')= 1 andName <> 'dtproperties'
Query the name of a data table with
Using system. data. sqlclient; /// // obtain the names of all database servers in the LAN. /// // server name array public list getsqlservernames () { datatable datasources = sqlclientfactory. instance. createperformanceenumerator ().
Laravel
$houses = DB::table('houses')->join('status', 'houses.status_id', '=', 'status.id')->get()
housesTable has a status_id field, corresponding to the need to query to the status table name field;
What $houses gets inside is the status field in
Thinkphp 3.2
$use=D('classone');$db=$use->select(5);$arr = $db[0] ? $db[0] : '';foreach($arr as $key => $value){ $arrKey[] = $key;}
This, I took the name of the field to get into an array $arrKey, but I think this method is rather stupid,
///reflection gets the field name and value of the entity class///var dict = GetProperties (model); /// entity class /// Instantiation / public static Dictionary getproperties (T t) {var ret =
New Dictionary ();
if (t = = null) {return null;}
Recently with a project, the front-end ready-made, the development of back-end services, found that the original interface in the field names are uppercase, and the Java side of the JSON conversion class after the field names into lowercase, leading
1. Basic Query Statement (SELECT)SELECT *| field List from table 1, table 2, table n WHERE expression GROUP by has the LIMIT;SELECT Field 1, Field 2, field n from table or view WHERE query condition;Description: The SELECT statement determines the
No details about MySQL? # Common basic operations of the MySQL database SQL (StructuredQueryLanguage) Structured Query Language: * DDL (DataDefinitionLanguage) Data Definition Language * # create a database: createdatabase database name charsetutf8;
(1) Data Record Filtering:
SQL = "select * from data table where field name = field value orderby field name [desc]"
SQL = "select * from data table where field name like '% Field Value %' orderby field name [desc]"
SQL = "selecttop10 * from data
Recently encountered a problem in the work, due to the large amount of data so that the table to save user data, the project DAO layer using the MyBatis framework, and the use of XML to maintain SQL statements,
convenient for late DBA
To implement the dynamic incoming table name and column name, you need to make the following modificationsAdd attribute statementtype= "STATEMENT"At the same time, the variable values in SQL are changed to ${XXXX} instead of #{xxx}
1. Add a field:ALTER TABLE tablename add NEW_FIELD_ID type NOT null default ' 0 ';Cases:ALTER TABLE Mmanapp_mmanmedia add appid_id integer NOT null default 372;Add primary key: alter table tabelname add new_field_id type default 0 not
This article introduces some query statements commonly used by SQL beginners. if you need them, refer to them.
This article introduces some query statements commonly used by SQL beginners. if you need them, refer to them.
(1) data record
The son said: "Wen so know new, can for the teacher." Confucius said: "Brush up on old knowledge to learn new understanding and experience, with this point can become a teacher." "In particular, we have a program, whether it is a full stack of
(1) data record filtering:SQL = "select * from data table where field name = field value orderby field name [desc]"SQL = "select * from data table where field name like '% field value %' orderby field name [desc]"SQL = "select top10 * from data
1) Main Health1, the Operation table constraints(1) Non-null constraints(2) Field default value(3) Unique constraint(4) Main health constraint(5) Add the main health (emphasis)(6) Automatic increase2) Index1. Create a normal index (emphasis)2.
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.