Summary: We often use SQL date conversion, which lists all the code with date output as a stringOutput Format 2014-06-12Select CONVERT (varchar), GETDATE (), 23) Output format 2014-06-12 22:31:18The following are the various conversion date code numbers:------------------------------------------------------------------Select CONVERT (varchar), GETDATE (), 0): 20
Display format for timestamp time in Oracle Oracle database Time field We usually use the timestamp format, and before setting it, the queried data is similar to "2 July-January-08 12.04.35.877000 Morning",After the To_char function conversion, we get the following result: "2008-01-27 00:04:35:877000", in order to be able to modify the time directly, we only need to add the following settings in the System
SQL Statement conversion Format function cast, convertBoth cast and convert are often used. Specially extracted as an article, convenient to find.Both cast and convert can perform data type conversions. In most cases, the two perform the same function, but the convert also provides some special date format conversions, and cast does not have this function.Since c
SQL Statement conversion Format function cast, convertBoth cast and convert are often used. Specially extracted as an article, convenient to find.Both cast and convert can perform data type conversions. In most cases, the two perform the same function, but the convert also provides some special date format conversions, and cast does not have this function.Since c
1 After the value of the format
{0:D} small: Like 2005-5-6
{0:D} large: As of May 6, 2005
{0:f} full type
2 Current Time acquisition
DateTime.Now.ToShortDateString
3 format in Values
Date format conversion methods that may be used frequently in SQL Server:
SQL Server
I had a hard time importing SQL into Excel.
I had a hard time importing SQL into Excel.
Originally, the program runs normally. Sometimes some exceptions may occur because the user's excel document is not in the required format. I thought the same was true this time. After reading the data, I did not find any exceptions, and I did some data on my own. In fact,
SQL parameter format: Select * from TB where nD =: Nd and YD =: YD
To replace all parameters (with colons) in all SQL statements with data at one time,
StartSelect a regular expression.
Originally written like thisCopyCodeThe Code is as follows: strsql. Replace (/(: \ W +)/g, ("$1"). substring (1 ));
"$1" is always parsed as a string instead of a matching v
Tags: io ar for file data sp on C databaseWays to convert row data from a table in SQL Server to an XML-formatted file:Syntax: SELECT * FROM table name for XML path (name of parent node in XML file)Case:Create a User basic information table under the Movie Database [Userinfoes]:Use [Movie]GOCREATE TABLE [dbo]. [Userinfoes] ([UserId] [INT] IDENTITY (*) not NULL PRIMARY KEY,[UserName] [varchar] () not NULL,[Age] [INT] Not NULL,[Phone] [varchar] () NULL)
Set the SQL writing format of PLSQL developer
The PLSQL version I use is 7.1.4.
Setting method:
PL/SQL developer-> Tools-> preferences-> PLSQL beautifier-> rules File
Click Edit. In the window that appears, modify the items in sequence, modify the items, and click Save. Select the storage location,
My storage location is under the preferences folder of P
Sometimes we need to save the data read from the database as XML directly. Here we can achieve this through SQL statements.
First, create a table:Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Use [IP]Go/***** Object: Table [DBO]. [sitedata] script Date: 17:41:11 ******/Set ansi_nulls onGoSet quoted_identifier onGoSet ansi_padding onGoCreate Table [DBO]. [sitedata] ([ID] [int] identity (1, 1)
These days refer to MongoDB's incoming parameter format, find ({a:1, $or: {c:1,b:2}}), and write an array of data parsed by this incoming method and output with the analysis data, so that subsequent class use does not know whether the design method is practical, Inside the note may not write the wrong, after all, copy and paste their own also a lot of source code see the attachment, the results of the test data posted here to indicate what I want to d
-- SQL cascade deletion and cascade update format:
Create Table primary key table (ID int primary key, name varchar (20 ))
Create Table foreign key table (ID int references primary key table (ID) on Delete cascade on update cascade, age tinyint)
-- Oracle cascade deletion format:
Create Table primary key table (ID int primary key, name varchar2 (20 ))
Creat
Label:Both cast and convert are often used. Specially extracted as an article, convenient to find. Both cast and convert can perform data type conversions. In most cases, the two perform the same function, but the convert also provides some special date format conversions, and cast does not have this function. Since convert includes all the functions of cast, and convert has a date conversion, why do I need to use cast? In fact, this is for ansi/is
I often want to use data set parameters for processing stored procedures, but SQL server does not provide such services.
Oracle seems to have, and this is the gap ~~~
There is no way for SQL Server to be used in this way.
Although SQL server does not explicitly provide a data set parameter, we can use some of its functions to implement it.
XML en ~ That i
Use convert in SQL server2000 to get the datetime data type style (full)Processing of date data formats, two examples:CONVERT (varchar (16), time one, 20) results: 2007-02-01 08:02/* time is generally a field in the GETDATE () function or data table */CONVERT (varchar (10), time one, 23) Result: 2007-02-01/*varchar (10) represents the format of the date output, which can occur if not long enough */Statement
example, 5 format to 005, select right (1000 + 5, 3), huh, huh, isn't it very easy?
My problem has not been solved yet ~ Finally, I accidentally combined and found a solution. First, convert the number to float and then varchar, as shown below:SelectConvert(Varchar,Convert(Float, Conditionupperbound ))FromDBO. rewardstandard
So, My SQL is like this ~ Select Factorname, Rs. factorid,Rs. rewardstandar
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.