Home
Search results “Oracle date from int”
SQL Tutorial - SQL DATE Functions like GETDATE, DATEADD, CONVERT
 
09:54
http://www.learningsqlserver2008.com/ https://youtu.be/KmsmPOImpHo - Date functions in SQL Server 2012 GETDATE -- Today's date DATEADD - adding time interval to an existing Date DATEPART - return part of the date like year or month DATEDIFF - Give you the different between two dates DAY - returns the day of the month MONTH - return the Month of the Year YEAR - returns the year in the Sql expression CAST - Converts an expression of one data type to another in SQL Server 2008 R2 CONVERT - Convert expressions of one data type to another in sql server r2 SQL Tutorial
Views: 65999 baghul
MySQL 33 - Datetime, Date, Time Data Types
 
06:40
Next up on our MySQL to-do list is to learn about storing dates and times. There are various data types in MySQL for storing dates and times. It seems MySQL and databases likes to break everything up into multiple data types to make things more organized at the consequence of being confusing and annoying. This video is going to be talking about the DATETIME, DATE, and TIME data types. These are all used to store, you guessed it, dates and times. The one you choose depends on your needs. If you just need dates, choose DATE. If you just need times, choose TIME, if you need both stored together, choose DATETIME. Now you set a column one of these data types whenever you want every row for this field to have some sort of date, time or both…but how exactly is the data formatted? This requires us to understand some convention. For example, in the USA at least, if you have something like 4:30AM, by convention you know the hour is 4 and the minutes are 30. But this is just an agreed upon convention. MySQL has its own convention…For example 2017-02-02. The first thing is the year, the second is the month, and the third is the day. That is for the DATE. The convention for time is 22:54:30. The first is the hour (military time), the second is the minute, and the third is the seconds. Lastly, there can actually be fractions of seconds…up to microseconds! .123456. To use fractional seconds though you must specify to MySQL the precision of the TIME or DATETIME when you create it, for example DATETIME(6) would allow microsecond precision. How do you actually give a date to MySQL? By that I mean let's say you have a table with a column of DATETIME(6), and you want to give a value for that column, how do you format it? It's quoted. For example: '2017-02-02 22:54:30.333333' MySQL interprets this as a DATETIME. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 40860 Caleb Curry
How To Using Date Fomat In SQL Server
 
11:50
This video for the SQL Programmer beginner only it will show you how to using date format in SQL Server
Views: 15588 Sourn Sarim
auto increment in sql oracle - ( Auto increment field )
 
03:07
auto increment in sql oracle ----------------------------------------------- CREATE table customers ( customer_id int not null, customer_name varchar(50), primary key (customer_id) ); create sequence customer_id minvalue 1 start with 1 cache 10; insert into customers values(customer_id.nextval,'maxwel'); -- to drop sequence drop sequence customer_id
Views: 9930 Data Disc
Convert function in SQL | SQL convert, cast functions
 
14:09
This video talks about Convert function in SQL SQL convert, cast functions sql convert datetime to date sql convert int to varchar sql cast datetime to date sql cast int to varchar sql conversion functions sql conversions sql interview questions
Views: 634 Training2SQL MSBI
Oracle SQL Tutorial 33 - NUMBER Data Type
 
07:18
This video we are going to discuss the NUMBER data type. The Number data type is used to store integers, and real numbers. When you create a column as a NUMBER, you can store pretty huge or pretty small numbers in this column. Now there are two things you need to consider when working with numbers, and that is the precision as well as the how big the number is. For example, we can store the number 9.9. This has two significant digits. We could also store the number 9.9 X 10^4. In this situation, the number is much larger, but the number of significant digits is the same. 9.9 are the significant digits. When we expand this out we just have 99000, and the zeros are just used for size and are not considered "significant" in this situation. In fact, you get a max precision of 38, but a maximum value of 9.99 * 10^125. You can also use this data type to store very small numbers. Check the docs for the specifics on maximums and minimums. You can provide it with two pieces of information: Precision - The total number of digits. Scale - The number of digits to the right of the decimal. You do it in this format: NUMBER (precision, scale). The important thing to remember in this is that when you specify a precision, you will be limiting the max size of the numbers. The secret behind this data type is that it is actually stored in scientific notation. That is we store a number and then we can multiply it by 10 raised to some power. This allows us to store much larger numbers without taking up a ton of space. The oracle docs actually gives a formula that you can use to see how much storage is going to be required for a specific NUMBER data type. How much precision can be used? The acceptable range is 1-38. What about scale? The range is actually -84 to 127. I'll explain the scale in more detail in an upcoming video. That's because there is a lot of confusing things here…What does it mean for the scale to be negative? How can we have a scale that is bigger that the total number of digits available through the precision. That's a topic for another video. It's important to understand that when we increase our scale, we decrease the max size of the number. For example if we have a precision of 5 and a scale of 3, the highest number we can store is 99.999. This is in contrast to a precision of 5 and a scale of 2 which allows for up to 99.999. Either way you get 5 significant digits, but the numbers of digits to the left and right of the decimal change. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 9156 Caleb Curry
SQL Tutorial - 34: ROUND() Function
 
06:51
In this tutorial we'll see how we can round off numbers conveniently in SQL using the ROUND() Function/
Views: 37862 The Bad Tutorials
Oracle Tutorial - Numerical/Math Functions TRUNC | MOD
 
08:37
Oracle Tutorials: Numric/Math Functions TRUNC and MOD
Views: 99 Tech Acad
12. DATE, DATATIME and TIMESTAMP Data Type in SQL (Hindi)
 
02:24
Please Subscribe Channel Like, Share and Comment Visit : www.geekyshows.com
Views: 35186 Geeky Shows
Smart tMap: Automatic Input-Output Data Type Conversion
 
01:53
See what's new in our latest version - http://www.talend.com/products This video shows how to let tMap automatically convert data types when the input and output schemas across tMap are of different data types. Conventionally, in a Job that contains a tMap, if the input and output columns across a mapping are of different data types, the Job would fail because of compiling errors. Now with this feature activated, the tMap becomes smart: it automatically converts the data type at runtime without needing any additional components or manual configuration.
Views: 2621 Talend
SQL Tutorial - 13: Inserting Data Into a Table From Another Table
 
07:00
In this tutorial we'll learn to use the INSERT Query to copy data from one table into another.
Views: 270305 The Bad Tutorials
SQL Tutorial - 7: Data-Types in SQL (Part-2)
 
06:48
In this tutorial we';; check out the data type options we have available for use in SQL. We'll talk about Bigint, int, smallint, tinyint, decimal, number, float, char, varchar, blob, datetime, date, time and year.
Views: 103172 The Bad Tutorials
SQL 36, trunc function
 
02:36
What you can do with trunc function in SQL
Views: 4297 hammadshams
How to convert a String to a DateTime in C# NET 2012
 
04:12
convert a String to a DateTime.
Views: 7931 Mr Code Monster
11-Oracle Database  CONCAT,SUBSTR, LENGTH, INSTR, LPAD,RPAD, TRIM, Round,Trunc,Mod.avi
 
33:16
11-Oracle Database - Intro to Types of Single Row Functions - CONCAT,SUBSTR, LENGTH, INSTR, LPAD,RPAD, TRIM, Round,Trunc,Mod.avi
Views: 4554 Adel Sabour
Cast function in SQL | SQL data conversions
 
12:35
This video talks about Cast function in SQL SQL data conversions convert data type to another data type sql convert functions convert functions in sql sql cast functions sql convert datetime to date sql cast decimal to int Part of SQL interview questions and answers sql questions and answers
Views: 502 Training2SQL MSBI
TO_CHAR(datetime) Function in SQL Query
 
03:59
TO_CHAR (datetime) : TO_CHAR (datetime) converts a datetime datatype to a value of VARCHAR2 datatype in the format specified by the date format. The following is a list of valid parameters when the TO_CHAR function is used to convert a date to a string. These parameters can be used in many combinations. YEAR Year, spelled out YYYY 4-digit year YYY Last 3 digits of year. YY Last 2 digits of year. Y Last 1 digit of year. IYYY 4-digit year based on the ISO standard Q Quarter of year (1, 2, 3, 4; JAN-MAR = 1). MM Month (01-12; JAN = 01). MON Abbreviated name of month. MONTH Name of month, padded with blanks to length of 9 characters. RM Roman numeral month (I-XII; JAN = I). WW Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year. W Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh. IW Week of year (1-52 or 1-53) based on the ISO standard. D Day of week (1-7). DAY Name of day. DD Day of month (1-31). DDD Day of year (1-366). DY Abbreviated name of day. J Julian day; the number of days since January 1, 4712 BC. HH Hour of day (1-12). HH12 Hour of day (1-12). HH24 Hour of day (0-23). MI Minute (0-59). SS Second (0-59). SSSSS Seconds past midnight (0-86399). FF Fractional seconds. Thanks for watching...:)
Views: 10731 WingsOfTechnology
TRY CONVERT function in SQL Server 2012
 
07:46
try convert function in sql sql server try_convert try_convert in sql server 2012 try convert sql try_parse vs try_convert sql server In this video we will discuss TRY_CONVERT function Difference between CONVERT and TRY_CONVERT functions Difference between TRY_PARSE and TRY_CONVERT functions TRY_CONVERT function Introduced in SQL Server 2012 Converts a value to the specified data type Returns NULL if the provided value cannot be converted to the specified data type If you request a conversion that is explicitly not permitted, then TRY_CONVERT fails with an error Syntax : TRY_CONVERT ( data_type, value, [style] ) Style parameter is optional. The range of acceptable values is determined by the target data_type. For the list of all possible values for style parameter, please visit the following MSDN article https://msdn.microsoft.com/en-us/library/ms187928.aspx Example : Convert string to INT. As the string can be converted to INT, the result will be 99 as expected. SELECT TRY_CONVERT(INT, '99') AS Result Example : Convert string to INT. The string cannot be converted to INT, so TRY_CONVERT returns NULL SELECT TRY_CONVERT(INT, 'ABC') AS Result Example : Converting an integer to XML is not explicitly permitted. so in this case TRY_CONVERT fails with an error SELECT TRY_CONVERT(XML, 10) AS Result If you want to provide a meaningful error message instead of NULL when the conversion fails, you can do so using CASE statement or IIF function. Example : Using CASE statement to provide a meaningful error message when the conversion fails. SELECT CASE WHEN TRY_CONVERT(INT, 'ABC') IS NULL THEN 'Conversion Failed' ELSE 'Conversion Successful' END AS Result Output : As the conversion fails, you will now get a message 'Conversion Failed' instead of NULL Example : Using IIF function to provide a meaningful error message when the conversion fails. SELECT IIF(TRY_CONVERT(INT, 'ABC') IS NULL, 'Conversion Failed', 'Conversion Successful') AS Result What is the difference between CONVERT and TRY_CONVERT CONVERT will result in an error if the conversion fails, where as TRY_CONVERT will return NULL instead of an error. Since ABC cannot be converted to INT, CONVERT will return an error SELECT CONVERT(INT, 'ABC') AS Result Since ABC cannot be converted to INT, TRY_CONVERT will return NULL instead of an error SELECT TRY_CONVERT(INT, 'ABC') AS Result Example : Using TRY_CONVERT() function with table data. We will use the following Employees table for this example. SQL Script to create Employees table Create table Employees ( Id int primary key identity, Name nvarchar(10), Age nvarchar(10) ) Go Insert into Employees values ('Mark', '40') Insert into Employees values ('John', '20') Insert into Employees values ('Amy', 'THIRTY') Insert into Employees values ('Ben', '21') Insert into Employees values ('Sara', 'FIFTY') Insert into Employees values ('David', '25') Go The data type of Age column is nvarchar. So string values like (THIRTY, FIFTY ) are also stored. Now, we want to write a query to convert the values in Age column to int and return along with the Employee name. Notice TRY_CONVERT function returns NULL for the rows where age cannot be converted to INT. SELECT Name, TRY_CONVERT(INT, Age) AS Age FROM Employees If you use CONVERT instead of TRY_CONVERT, the query fails with an error. SELECT NAME, CONVERT(INT, Age) AS Age FROM Employees The above query returns the following error Conversion failed when converting the nvarchar value 'THIRTY' to data type int. Difference between TRY_PARSE and TRY_CONVERT functions TRY_PARSE can only be used for converting from string to date/time or number data types where as TRY_CONVERT can be used for any general type conversions. For example, you can use TRY_CONVERT to convert a string to XML data type, where as you can do the same using TRY_PARSE Converting a string to XML data type using TRY_CONVERT SELECT TRY_CONVERT(XML, '[root][child/][/root]') AS [XML] Converting a string to XML data type using TRY_PARSE SELECT TRY_PARSE('[root][child/][/root]' AS XML) AS [XML] The above query will result in the following error Invalid data type xml in function TRY_PARSE Another difference is TRY_PARSE relies on the presence of .the .NET Framework Common Language Runtime (CLR) where as TRY_CONVERT does not. Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/tryconvert-function-in-sql-server-2012.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/tryconvert-function-in-sql-server-2012_16.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 27999 kudvenkat
DevOps with Linux and Virtualization
 
57:05
Simon Coter, Product Management Director, Oracle VM & VirtualBox. Learn how to build a 100% reproducible environment which creates an up-to-date Oracle Linux 7 and requires no user intervention at all other than a single command. Thanks to technologies like Vagrant, VirtualBox and Oracle Linux, build a consistent workflow to create disposable Linux environment whose configuration and dependencies are isolated from your development machine on every platform (Windows, MacOS or Linux). ================================= To improve the video quality, click the gear icon and set the Quality to 1080p/720p HD. For more information, see http://www.oracle.com/goto/oll and http://docs.oracle.com Copyright © 2017 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Session6 Data type in Oracle
 
15:25
Session 6: Datatypes In Oracle   ALPHABET           : A-Z , a-z NUMBER              : 0-9 (with precision and scale) DATE / Temporal  : any Date and time (Hours, Minutes, Seconds, Mili-seconds, Timestamp, Timezone etc)   Alphabet + Number = Alphanumeric Data                                     = String / CHARACTER Datatype Category Number                    =  Numeric Datatype Category Date                         = Date Datatype Category 1. CHARACTER Datatype: CHAR, VARCHAR, NCHAR: CHAR is fixed length datatype and VARCHAR is Variable length datatype to store character data. i.e. A-Z , a-z , 0-9 , all keyboard characters etc. The default size is 1 character and it can store maximum up to 2000 bytes. Example : EName, EmpID, PassportNo, SSN, etc. EName CHAR(10) := ‘TOM’; wastage of 7 space after the string EName VARCHAR(10) := ‘TOM’; Spaces can be Reuse which left after the string NCHAR additionally handles NLS(National Language Support). Oracle supports a reliable Unicode datatype through NCHAR , NVARCHAR2 , and NCLOB  VARCHAR2, NVARCHAR2: These are Variable length datatype. VARCHAR2 handles alphanumeric character string whereas NVARCHAR2 handles alphanumeric character string with NLS(National Language Support). The default size is 1 character and it can store maximum up to 4000 bytes.   LONG:  Variable length string.  (Maximum size: 2 GB - 1) Only one LONG column is allowed per table. RAW:    Variable length binary string (Maximum size 2000 bytes) LONG RAW: Variable length binary string (Maximum size 2GB) 2. NUMERIC Datatype: NUMBER: It stores Numeric values and performs numeric calculations. NUMBER,   NUMBER(n),   NUMBER(p,s) It stores Numbers up to 38 digits of precision. SeqNo NUMBER;                     1, 123, 12345678 EmpID NUMBER(4);                 1, 123, 1234 Sal NUMBER(7,2);                     23456.78 , 123.45 — correction in video: Sal NUMBER(a7,2); which is wrong please ignore. 1234567 can be a type of NUMBER, NUMBER(7), NUMBER(7,0) It can store both integer and floating point numbers NUMERIC(p,s) FLOAT:   Ex:  EmpSal FLOAT;    FLOAT(7)       Decimal Points allowed DEC(p,s), DECIMAL(p,s) , REAL, DOUBLE PRECISION INTEGER:   Ex:  SSN INTEGER;       Decimal Points are not allowed INT, SMALLINT 3. DATE Datatype: DATE: It stores DATE(Date, Month, Year) and Time(Hour, Minute, Second, AM/PM) and performs calculations with such data. Default DATE format in Oracle is “DD-MON-YY” Based on "Gregorian calendar" where the date ranges from “JAN 1 4712 BC” to “DEC 31 9999 AD” doj DATE;    “18-MAR-2010 12:30:00 PM” TIMESTAMP:    It can store all parameters as DATE datatype and additionally it can have “Fraction of seconds” and TIMESTAMP WITH TIMEZONE / TIMESTAMP WITHOUT TIMEZONE. Range from 0-9 digits, the default size is 6. 4. LOB Datatype: LOB: “Large Object” data. It can store pictures, motion pictures, Textfiles etc. CLOB: “Character Large Object” is used to store structured information like a text file with a specific file format. BLOB: “Binary Large Object” is used to store Un-structured information like Image, JPEG files, MPEG files etc. BFILE: “Binary File” is used to store the pointer to a specific file / Just store the location of a file. Maximum size: (4 GB - 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB) Extra Information: NCLOB : It supports all the character set supported by CLOB and additionally it handles NLS(National Language Support ) Maximum size: (4 GB - 1) * DB_BLOCK_SIZE initialization parameter (8 TB to 128 TB) ROWID and UROWID(optional size) Datatype: contains fixed length Binary data. BBBBBBB.RRRR.FFFFF combination of BLOCK-ROW-DATABASE FILE Physical and Logical ROWID Upcoming Session: Session 7: Populating Data into Tables(INSERT Statement): Inserting data into all columns of a table Inserting data into Required columns of a table Inserting NULL value into a table Inserting Special Values(USER / SYSDATE) into a table Supplying data at runtime(using & and &&) THANK YOU :)
Views: 374 Prabhat Sahu
SQL Server    Select from Date Part of DateTime Field with Cast
 
01:07
Declare @t1 Table (OrderNumber int, OrderDate DateTime) INSERT INTO @t1 VALUES (1, GETDATE()) INSERT INTO @t1 VALUES (2,GETDATE()) Select * from @t1 Select * from @t1 where CAST(OrderDate as Date) = '2017-05-27'
Views: 611 CKWTech LLC
Oracle SQL Tutorial 24 - Important Data Types
 
06:09
In the upcoming videos we are going to discuss data types in depth, but I don't want to drown you in all of the details. Because of that, I'm giving you this video which is going to introduce you to the most important data types. Then, in the upcoming videos, I'll describe them in more depth. One of the data types we've already discussed in this video is NUMBER. This data type is used to, obviously, store a number. It can be used to store integers (whole numbers), or numbers with decimals. There are two other numeric data types you should know of. BINARY_FLOAT and BINARY_DOUBLE are both numeric data types that are known as floating point numbers. A floating point number is often used for large numbers that have decimal places where it is acceptable to not be completely precise. What I mean by this is that these numbers can only store numbers correctly up to a certain decimal point. If you need perfect precision, you will want to use the NUMBER data type. Now storing numbers is good sometimes, but occasionally you will want to store string data. String data can be any sequence of characters, including numbers. By telling the database that a column is a string data type, the database knows how to treat that column. There are four important string data types that you need to know about. The first two are CHAR and NCHAR. These data types are used to store a fixed-length string. So for example, you can say you want to store 12 characters. This means that every value for this column will be exactly 12 characters. If you insert less than 12 characters, the data will be padded with spaces. This means you will want to use one of these data types when every value in the column is the same length. What is the difference between CHAR and NCHAR? CHAR uses what is known as ASCII while NCHAR uses Unicode. The difference is what characters are allowed and how much space each character takes. ASCII takes up less space but only supports English, numbers, and some symbols. UNICODE allows you to store characters from multiple languages but takes up more space. Those were both fixed-length string. What if you want to store data that changes in length? That is where VARCHAR2 and NVARCHAR2 come in. When it comes to storing dates, the data types that are most important are DATE and TIMESTAMP. Date can be used to store dates and time. Timestamp is a data type that can be used to store an exact moment in time. Lastly, there are interval types. These store a date range. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 7505 Caleb Curry
Date and Time Functions in SQL SERVER Part I || CURRENT_TIMESTAMP and DATEADD
 
04:32
This video will provide you the details of each Date and Time Data Types and Function in SQL Server 2014. I'll be walking through each and every kinds of build in function which are available in SQL Server in my next videos. Date and Time Data Types and Functions :-  CURRENT_TIMESTAMP (Transact-SQL) Returns the current database system timestamp as a datetime value without the database time zone offset. This value is derived from the operating system of the computer on which the instance of SQL Server is running. This function is the ANSI SQL equivalent to GETDATE.  Syntax CURRENT_TIMESTAMP  Arguments Takes no arguments.  Return Type Datetime  Remarks Transact-SQL statements can refer to CURRENT_TIMESTAMP anywhere they can refer to a datetime expression.CURRENT_TIMESTAMP is a nondeterministic function. Views and expressions that reference this column cannot be indexed. *********************************************************************  DATEADD (Transact-SQL) Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date.  Syntax DATEADD (datepart , number , date )  Arguments datepart Is the part of date to which an integernumber is added. The following table lists all valid datepart arguments. User-defined variable equivalents are not valid. datepart Abbreviations year yy, yyyy quarter qq, q month mm, m dayofyear dy, y day dd, d week wk, ww weekday dw, w hour hh minute mi, n second ss, s millisecond ms microsecond mcs nanosecond ns number Is an expression that can be resolved to an int that is added to a datepart of date. User-defined variables are valid. If you specify a value with a decimal fraction, the fraction is truncated and not rounded. date Is an expression that can be resolved to a time, date, smalldatetime, datetime, datetime2, or datetimeoffset value. date can be an expression, column expression, user-defined variable, or string literal. If the expression is a string literal, it must resolve to a datetime. To avoid ambiguity, use four-digit years. For information about two-digit years,  Return Types The return data type is the data type of the date argument, except for string literals. The return data type for a string literal is datetime. An error will be raised if the string literal seconds scale is more than three positions (.nnn) or contains the time zone offset part.  Return Value  datepart Argument dayofyear, day, and weekday return the same value. Each datepart and its abbreviations return the same value. If datepart is month and the date month has more days than the return month and the date day does not exist in the return month, the last day of the return month is returned. For example, September has 30 days; therefore, the two following statements return 2006-09-30 00:00:00.000: SELECT DATEADD(month, 1, '2006-08-30'); SELECT DATEADD(month, 1, '2006-08-31');  number Argument The number argument cannot exceed the range of int. In the following statements, the argument for number exceeds the range of int by 1. The following error message is returned: "Msg 8115, Level 16, State 2, Line 1. Arithmetic overflow error converting expression to data type int." SELECT DATEADD(year,2147483648, '2006-07-31'); SELECT DATEADD(year,-2147483649, '2006-07-31');  date Argument The date argument cannot be incremented to a value outside the range of its data type. In the following statements, the number value that is added to the date value exceeds the range of the date data type. The following error message is returned: "Msg 517, Level 16, State 1, Line 1 Adding a value to a 'datetime' column caused overflow." SELECT DATEADD(year,2147483647, '2006-07-31'); SELECT DATEADD(year,-2147483647, '2006-07-31');  Return Values for a smalldatetime date and a second or Fractional Seconds datepart The seconds part of a smalldatetime value is always 00. If date is smalldatetime, the following apply: • If datepart is second and number is between -30 and +29, no addition is performed. • If datepart is second and number is less than-30 or more than +29, addition is performed beginning at one minute. • If datepart is millisecond and number is between -30001 and +29998, no addition is performed. • If datepart is millisecond and number is less than -30001 or more than +29998, addition is performed beginning at one minute.
Views: 342 Softtech forum
Oracle SQL 4th Session
 
01:06:22
create table invoice_mst ( id varchar(250) not null primary key, client_id int, create_time date, create_user int, update_user int, update_time date, foreign key (client_id) references clients(id) ); alter table tbl_student add CONSTRAINT fk_tbl_student_dept_id foreign key(dept_id) references tbl_department(id); insert into tbl_department(id, name) values(1,'CSE'); insert into tbl_department(id, name) values(2,'ETE'); insert into tbl_department(id, name) values(3,'EEE'); insert into tbl_department(id, name) values(4,'ICE'); INSERT INTO TBL_STUDENT (ID, F_NAME, DEPT_ID) VALUES(1,'A',10) DELETE FROM "SOFTSMAKER"."TBL_DEPARTMENT" WHERE ROWID = 'AAAV4JAAEAAAPyfAAB' AND ORA_ROWSCN = '8349523' and ( "ID" is null or "ID" is not null ) ORA-02292: integrity constraint (SOFTSMAKER.FK_TBL_STUDENT_DEPT_ID) violated - child record found
Views: 17 Little Legend
Tutorial#5 Why/When/Where we use  data type in oracle database
 
17:50
tutorial on oracle data type like Number blob/clob/nclob/(integer)/varchar2/varchar/char/nvarchr2/ncharvarchar2/date/long/rowid Giving the in-depth explanation on the data type of Oracle database -------------------------------------------------- Oracle SQL Practice Question: https://drive.google.com/open?id=1FfoIhRvGfgPnTfEV7ZqBjl1q4sZ2ePr_ -------------------------------------------------- Frequently asked interview question on Oracle SQL https://www.youtube.com/watch?v=f7E30fV8wJA&index=1&list=PLiLpmqwkwkCv4qmtBnz4M3zIs1_ukkboT In this video, you will get the answer to the following question what is Oracle data type where to use Oracle data type why we Oracle data type oracle data types tutorial In this series we cover the following topics: SQL basics, create table oracle, SQL functions, SQL queries, SQL server, SQL developer installation, Oracle database installation, SQL Statement, OCA, Data Types, Types of data types, SQL Logical Operator, SQL Function,Join- Inner Join, Outer join, right outer join, left outer join, full outer join, self-join, cross join, View, SubQuery, Set Operator. follow me on: Facebook Page: https://www.facebook.com/LrnWthr-319371861902642/?ref=bookmarks Contacts Email: [email protected] Instagram: https://www.instagram.com/lrnwthr/ Twitter: https://twitter.com/LrnWthR
Views: 475 EqualConnect Coach
How to Concatenate String Values with Integer values in SQL Server - TSQL Tutorial
 
10:23
How to Concatenate String and Integer Values in SQL Server ( + Sign vs CONCAT ) - TSQL Tutorial Working with Databases is fun. On daily basis we save data into tables in different columns and often we need to write queries which involve concatenation of multiple columns of different datatypes to produce our final output. In below example we have saved some data into #Customer Table which has Street Address column as string and zip as INT. we want to produce Full Address by concatenating these columns. To concatenate we can use + sign but this works only with String values. So if we have any Integer value/s we have to convert them to String first. We can use Cast or Convert function to convert Integer value to string. Also if there is any Null value among which values we are concatenating , our output will be Null by using + sign. To take care of that part we can use either ISNULL() or Coalesce Function to replace NULL with blank value in SQL Server. In SQL Server 2012 and Later versions, CONCAT function was introduced. You can concatenate multiple values by using this function. Fun part of this function is you don't have to worry about Null outcome as it will Ignore Null values and also you don't have to worry about converting INT into strings, It will take care of that automatically. So if you are using new versions such as 2012 or later, start taking advantage of this function. Blog post link for the video with script http://sqlage.blogspot.com/2015/03/how-to-concatenate-string-and-integer.html
Views: 16046 TechBrothersIT
Java prog#44.How to save/insert date into SqLite(MySql) using Jdatechooser in Netbeans java
 
13:56
------------------Online Courses to learn---------------------------- Java - https://bit.ly/2H6wqXk C++ - https://bit.ly/2q8VWl1 AngularJS - https://bit.ly/2qebsLu Python - https://bit.ly/2Eq0VSt C- https://bit.ly/2HfZ6L8 Android - https://bit.ly/2qaRSAS Linux - https://bit.ly/2IwOuqz AWS Certified Solutions Architect - https://bit.ly/2JrGoAF Modern React with Redux - https://bit.ly/2H6wDtA MySQL - https://bit.ly/2qcF63Z ----------------------Follow--------------------------------------------- My Website - http://www.codebind.com My Blog - https://goo.gl/Nd2pFn My Facebook Page - https://goo.gl/eLp2cQ Google+ - https://goo.gl/lvC5FX Twitter - https://twitter.com/ProgrammingKnow Pinterest - https://goo.gl/kCInUp Text Case Converter - https://goo.gl/pVpcwL -------------------------Stuff I use to make videos ------------------- Stuff I use to make videos Windows notebook – http://amzn.to/2zcXPyF Apple MacBook Pro – http://amzn.to/2BTJBZ7 Ubuntu notebook - https://amzn.to/2GE4giY Desktop - http://amzn.to/2zct252 Microphone – http://amzn.to/2zcYbW1 notebook mouse – http://amzn.to/2BVs4Q3 ------------------Facebook Links ---------------------------------------- http://fb.me/ProgrammingKnowledgeLearning/ http://fb.me/AndroidTutorialsForBeginners http://fb.me/Programmingknowledge http://fb.me/CppProgrammingLanguage http://fb.me/JavaTutorialsAndCode http://fb.me/SQLiteTutorial http://fb.me/UbuntuLinuxTutorials http://fb.me/EasyOnlineConverter how can i insert date in yyyy-mm-dd format jdatechooser Creating a DateChooser Control with Java how to save date into database using jdatechooser in netbeans java netbeans java tutorial how to insert data from netbeans into database Insert information into a MySQL database - NetBeans - Java Insert Data Into Mysql Database Using Netbeans Insert Data Of Textfields In Database "netbeans"‎ Insert Data Into Database Using Netbeans to insert, update and delete new data into mysql database using jbutton. How to insert data into database how to insert java.sql.data into database
Views: 75974 ProgrammingKnowledge
CONCAT & PIPE "||" Operators in Oracle | Oracle Tutorials for Beginners
 
07:13
CONCAT & PIPE "||" Operators in Oracle | Oracle Tutorials for Beginners Oracle Tutorials for Beginners CONCAT Operators in Oracle SQL CONCAT Operators in Oracle Database CONCAT Operators in Oracle SQL Database || Operator in Oracle concatenate in oracle sql developer oracle concatenate columns with space oracle concatenate rows into string oracle concatenate string and number oracle concatenate all columns into string oracle concatenate columns with comma using concat function in oracle concatenate function in oracle 11g concatenate in oracle sql developer oracle sql concatenate column values concatenation operator in oracle concatenation operator in sql server oracle concatenate columns with space oracle concatenate string and number oracle concatenate rows into string concatenate in oracle sql query concatenate sql query concat sql server 2008 sql concatenate columns concatenate sql oracle sql concatenate rows mysql concatenate string sql concatenate string and int sql concatenate column values
Views: 1109 Oracle PL/SQL World
Calculate running total in SQL Server 2012
 
06:23
running total sql server cumulative total in ms sql server running total column In this video we will discuss how to calculate running total in SQL Server 2012 and later versions. We will use the following Employees table for the examples in this video. SQL Script to create Employees table Create Table Employees ( Id int primary key, Name nvarchar(50), Gender nvarchar(10), Salary int ) Go Insert Into Employees Values (1, 'Mark', 'Male', 5000) Insert Into Employees Values (2, 'John', 'Male', 4500) Insert Into Employees Values (3, 'Pam', 'Female', 5500) Insert Into Employees Values (4, 'Sara', 'Female', 4000) Insert Into Employees Values (5, 'Todd', 'Male', 3500) Insert Into Employees Values (6, 'Mary', 'Female', 5000) Insert Into Employees Values (7, 'Ben', 'Male', 6500) Insert Into Employees Values (8, 'Jodi', 'Female', 7000) Insert Into Employees Values (9, 'Tom', 'Male', 5500) Insert Into Employees Values (10, 'Ron', 'Male', 5000) Go SQL Query to compute running total without partitions SELECT Name, Gender, Salary, SUM(Salary) OVER (ORDER BY ID) AS RunningTotal FROM Employees SQL Query to compute running total with partitions SELECT Name, Gender, Salary, SUM(Salary) OVER (PARTITION BY Gender ORDER BY ID) AS RunningTotal FROM Employees What happens if I use order by on Salary column If you have duplicate values in the Salary column, all the duplicate values will be added to the running total at once. In the example below notice that we have 5000 repeated 3 times. So 15000 (i.e 5000 + 5000 + 5000) is added to the running total at once. SELECT Name, Gender, Salary, SUM(Salary) OVER (ORDER BY Salary) AS RunningTotal FROM Employees So when computing running total, it is better to use a column that has unique data in the ORDER BY clause. Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/calculate-running-total-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/calculate-running-total-in-sql-server_3.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 60253 kudvenkat
Date Time Data Types In SQL in Hindi Lesson 34
 
11:22
In this video we will learn about date time data types in SQL server.
Views: 1336 Vijay Mulsaniya
Date type conversion from any date format to any date format in DataStage
 
04:30
Use the type conversion functions to change the type of an argument. StringToDate Returns a date from the given string in the given format. You do not have to specify a format string if your string contains a date in the default format yyyy-mm-dd. Input: string (string) [,format (string)] Output: result (date) Examples: If the column mylink.mystring contains the string ″1958--08--18″, then the following function returns the date 1958--08--18. StringToDate(mylink.mystring) If the column mylink.mystring contains the string ″18:08:1958″, then the following function returns the date 1958--08--18. StringToDate(mylink.mystring,"%dd:%mm:%yyyy")
Views: 6355 WingsOfTechnology
SQL Tutorial - 9: Create Table Statement
 
07:48
In this tutorial we'll learn to create tables in SQL using the CREATE TABLE Statement.
Views: 366073 The Bad Tutorials
C# - How to convert date to quarter number
 
00:54
More info: http://howtodomssqlcsharpexcelaccess.blogspot.ca/2012/06/c-how-to-convert-date-to-quoter.html
Views: 754 Vis Dotnet
Part 12   Can we join two tables without primary foreign key relation
 
10:38
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/09/part-12-can-we-join-two-tables-without.html Can we join two tables without primary foreign key relation Yes, we can join two tables without primary foreign key relation as long as the column values involved in the join can be converted to one type. ID column in Departments table is not the primary Key and DepartmentId column in Employees table is not the foreign key. But we can still join these tables using ID column from Departments table and DepartmentId column from Employees table, as both the columns involved in the join have same data type i.e int. Select Employees.Name as EmployeeName, Departments.Name as DepartmentName from Employees join Departments on Departments.ID = Employees.DepartmentId The obious next question is, if primary foreign key relation is not mandatory for 2 tables to be joined then what is the use of these keys? Primary key enforces uniqueness of values over one or more columns. Since ID is not a primary key in Departments table, 2 or more departments may end up having same ID value, which makes it impossible to distinguish between them based on the ID column value. Foreign key enforces referential integrity. Without foreign key constraint on DepartmentId column in Employees table, it is possible to insert a row into Employees table with a value for DepartmentId column that does not exist in Departments table. The following insert statement, successfully inserts a new Employee into Employees table whose DepartmentId is 100. But we don't have a department with ID = 100 in Departments table. This means this employee row is an orphan row, and the referential integrity is lost as result Insert into Employees values (8, 'Mary', 'Female', 80000, 100) If we have had a foreign key constraint on DepartmentId column in Employees table, the following insert statement would have failed with the following error. Msg 547, Level 16, State 0, Line 1 The INSERT statement conflicted with the FOREIGN KEY constraint. The conflict occurred in database "Sample", table "dbo.Departments", column 'ID'.
Views: 126122 kudvenkat
Oracle ROUND: Number function
 
03:48
Oracle TRUNC: Number function https://www.youtube.com/watch?time_continue=3&v=4lchx4sseEM Oracle MOD: Number function https://www.youtube.com/watch?v=eMGgo_1y6b4&feature=youtu.be The usage of SELECT Playlist: https://www.youtube.com/watch?v=ZwgiIiD1dWE&list=PLjBraywgeSpEW2f7AK4Ddt6BRxW0HWN74
Oracle SQL Generate Random Alphanumeric String
 
07:21
In this video, you’ll learn how to generate random alphanumeric characters in an SQL statement in Oracle SQL You can use Oracle SQL to generate random alphanumeric string values by using one of the built-in functions. This function allows you to specify the type of string to generate - upper or lowercase alpha characters only, mixed alpha characters, uppercase alphanumeric characters, or any printable characters. You can also specify the length of the string to generate, This can be a fixed number, or you can use another function to generate a random number to use for the length! You’ll see some examples of generating random alphanumeric string values in this video. For more information and tips on Oracle SQL, check out DatabaseStar.com: https://www.databasestar.com/
Views: 616 Database Star
MySQL 30 - INT Data Type
 
03:02
The last section of videos covered the string data types, now we are going to move on to the numeric data types. This video is going to discuss the INTEGER data types, or the INT data types. These data types are used to store whole numbers. That is, numbers without anything after a decimal. Just like with the TEXT data type, INT is broken up into multiple data types that can be used. It is actually broken up into 5 different data types. TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT. Now, the confusing part here is the naming. That's because the only thing we have to compare this naming to is the TEXT data types. But they don't follow a consistent naming convention. For example, MEDIUMTEXT is larger than TEXT, but MEDIUMINT is smaller than INT. Additionally, there are 5 data types for the INT data type group, and lastly the biggest INT data type is called BIGINT whereas the biggest TEXT data type is called LONGTEXT. These are used to store exact values. What that means is that if you store a number and use it, you expect it to maintain precision. There are data types that are used for estimated values which we are going to discuss in more detail in an upcoming video. For now, let's focus on INT data types. You can find the exact storage limits for each of these, but here is some info: TINYINT - 255 SMALLINT - 65535 MEDIUMINT - 16 Million INT - 4 Billion BIGINT - Stinkin' a lot (18446744073709551615) Now note, in this situation, we will have to label each one of these as UNSIGNED. An unsigned number does not allow for negatives, but allows higher positive numbers. You can look up the INT data types to get the exact ranges for signed and unsigned. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! http://www.patreon.com/calebcurry Subscribe to my newsletter: http://bit.ly/JoinCCNewsletter Donate!: http://bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: http://CalebCurry.com Facebook: http://www.facebook.com/CalebTheVideoMaker Google+: https://plus.google.com/+CalebTheVideoMaker2 Twitter: http://twitter.com/calebCurry Amazing Web Hosting - http://bit.ly/ccbluehost (The best web hosting for a cheap price!)
Views: 4685 Caleb Curry
Part 1   How to find nth highest salary in sql
 
11:45
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/05/part-1-how-to-find-nth-highest-salary_17.html This is a very common SQL Server Interview Question. There are several ways of finding the nth highest salary. By the end of this video, we will be able to answer all the following questions as well. How to find nth highest salary in SQL Server using a Sub-Query How to find nth highest salary in SQL Server using a CTE How to find the 2nd, 3rd or 15th highest salary Let's use the following Employees table for this demo Use the following script to create Employees table Create table Employees ( ID int primary key identity, FirstName nvarchar(50), LastName nvarchar(50), Gender nvarchar(50), Salary int ) GO Insert into Employees values ('Ben', 'Hoskins', 'Male', 70000) Insert into Employees values ('Mark', 'Hastings', 'Male', 60000) Insert into Employees values ('Steve', 'Pound', 'Male', 45000) Insert into Employees values ('Ben', 'Hoskins', 'Male', 70000) Insert into Employees values ('Philip', 'Hastings', 'Male', 45000) Insert into Employees values ('Mary', 'Lambeth', 'Female', 30000) Insert into Employees values ('Valarie', 'Vikings', 'Female', 35000) Insert into Employees values ('John', 'Stanmore', 'Male', 80000) GO To find the highest salary it is straight forward. We can simply use the Max() function as shown below. Select Max(Salary) from Employees To get the second highest salary use a sub query along with Max() function as shown below. Select Max(Salary) from Employees where Salary [ (Select Max(Salary) from Employees) To find nth highest salary using Sub-Query SELECT TOP 1 SALARY FROM ( SELECT DISTINCT TOP N SALARY FROM EMPLOYEES ORDER BY SALARY DESC ) RESULT ORDER BY SALARY To find nth highest salary using CTE WITH RESULT AS ( SELECT SALARY, DENSE_RANK() OVER (ORDER BY SALARY DESC) AS DENSERANK FROM EMPLOYEES ) SELECT TOP 1 SALARY FROM RESULT WHERE DENSERANK = N To find 2nd highest salary we can use any of the above queries. Simple replace N with 2. Similarly, to find 3rd highest salary, simple replace N with 3. Please Note: On many of the websites, you may have seen that, the following query can be used to get the nth highest salary. The below query will only work if there are no duplicates. WITH RESULT AS ( SELECT SALARY, ROW_NUMBER() OVER (ORDER BY SALARY DESC) AS ROWNUMBER FROM EMPLOYEES ) SELECT SALARY FROM RESULT WHERE ROWNUMBER = 3
Views: 1001346 kudvenkat
Learn MySQL In Arabic #05 - Data Type - Numeric
 
20:01
Learn about The Numeric Data Type in MySQL with Examples Int TinyInt SmallInt MediumInt BigInt Float Decimal Real BIt Boolean
Views: 21111 Elzero Web School
Difference between rows and range
 
05:52
range vs rows in sql server difference between rows clause and range clause in sql server range clause vs rows clause in sql server sql server running total query running total example in sql server In this video we will discuss the difference between rows and range in SQL Server. This is continuation to Part 116. Please watch Part 116 from SQL Server tutorial before proceeding. Let us understand the difference with an example. We will use the following Employees table in this demo. SQL Script to create the Employees table Create Table Employees ( Id int primary key, Name nvarchar(50), Salary int ) Go Insert Into Employees Values (1, 'Mark', 1000) Insert Into Employees Values (2, 'John', 2000) Insert Into Employees Values (3, 'Pam', 3000) Insert Into Employees Values (4, 'Sara', 4000) Insert Into Employees Values (5, 'Todd', 5000) Go Calculate the running total of Salary and display it against every employee row The following query calculates the running total. We have not specified an explicit value for ROWS or RANGE clause. SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary) AS RunningTotal FROM Employees So the above query is using the default value which is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW This means the above query can be re-written using an explicit value for ROWS or RANGE clause as shown below. SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees We can also achieve the same result, by replacing RANGE with ROWS SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees What is the difference between ROWS and RANGE To understand the difference we need some duplicate values for the Salary column in the Employees table. Execute the following UPDATE script to introduce duplicate values in the Salary column Update Employees set Salary = 1000 where Id = 2 Update Employees set Salary = 3000 where Id = 4 Go Now execute the following query. Notice that we get the running total as expected. SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees The following query uses RANGE instead of ROWS SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RunningTotal FROM Employees Notice we don't get the running total as expected. So, the main difference between ROWS and RANGE is in the way duplicate rows are treated. ROWS treat duplicates as distinct values, where as RANGE treats them as a single entity. All together side by side. The following query shows how running total changes 1. When no value is specified for ROWS or RANGE clause 2. When RANGE clause is used explicitly with it's default value 3. When ROWS clause is used instead of RANGE clause SELECT Name, Salary, SUM(Salary) OVER(ORDER BY Salary) AS [Default], SUM(Salary) OVER(ORDER BY Salary RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS [Range], SUM(Salary) OVER(ORDER BY Salary ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS [Rows] FROM Employees Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/difference-between-rows-and-range.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/difference-between-rows-and-range_8.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 36919 kudvenkat
SQL CAST Function - how to use CAST Function
 
02:09
SQL CAST function converts an expression from one datatype to another datatype. visit Dose for excel Add-In website: http://www.zbrainsoft.com/ Visit our channel: https://www.youtube.com/channel/UCI4bMWYzrBTs47KINXL92Kw
Date Functions in SQL SERVER Part III || DATEPART, DATETIME2FROMPARTS, DATETIMEFROMPARTS and EOMONTH
 
04:31
This video will provide you the details of each Date and Time Data Types and Function in SQL Server 2014. Last session for date other date functions: Part I https://www.youtube.com/watch?v=2x29rH6nY3s Part II https://www.youtube.com/watch?v=A0NM91RIaLI *************************************************************************  DATEPART (Transact-SQL) Returns an integer that represents the specified datepart of the specified date.  Syntax DATEPART ( datepart , date )  Arguments datepart Is the part of date (a date or time value) for which an integer will be returned. The following table lists all valid datepart arguments. User-defined variable equivalents are not valid. date Is an expression that can be resolved to a time, date, smalldatetime, datetime, datetime2, or datetimeoffset value. date can be an expression, column expression, user-defined variable, or string literal. To avoid ambiguity, use four-digit years.  Return Type Int *************************************************************************  DATETIME2FROMPARTS (Transact-SQL) Returns a datetime2 value for the specified date and time and with the specified precision.  Syntax DATETIME2FROMPARTS ( year, month, day, hour, minute, seconds, fractions, precision )  Arguments year Integer expression specifying a year. month Integer expression specifying a month. Softtechforum day Integer expression specifying a day. hour Integer expression specifying hours. minute Integer expression specifying minutes. seconds Integer expression specifying seconds. fractions Integer expression specifying fractions. precision Integer literal specifying the precision of the datetime2 value to be returned.  Return Types datetime2( precision )  Examples • Example without fractions of a second SELECT DATETIME2FROMPARTS ( 2016, 12, 31, 23, 59, 59, 0, 0 ) AS Result; • Example with fractions of a second The following example demonstrates the use of the fractions and precision parameters: 1. When fractions has a value of 5 and precision has a value of 1, then the value of fractions represents 5/10 of a second. 2. When fractions has a value of 50 and precision has a value of 2, then the value of fractions represents 50/100 of a second. 3. When fractions has a value of 500 and precision has a value of 3, then the value of fractions represents 500/1000 of a second. Transact-SQL SELECT DATETIME2FROMPARTS (2016, 8, 15, 14, 23, 44, 5, 1 ); SELECT DATETIME2FROMPARTS (2016, 8, 15, 14, 23, 44, 50, 2 ); SELECT DATETIME2FROMPARTS (2016, 8, 15, 14, 23, 44, 500, 3 ); *************************************************************************  DATETIMEFROMPARTS (Transact-SQL) Returns a datetime value for the specified date and time.  Syntax DATETIMEFROMPARTS ( year, month, day, hour, minute, seconds, milliseconds )  Arguments year Integer expression specifying a year. month Integer expression specifying a month. day Integer expression specifying a day. hour Integer expression specifying hours. minute Integer expression specifying minutes. seconds Integer expression specifying seconds. milliseconds Integer expression specifying milliseconds.  Return Types datetime  Examples SELECT DATETIMEFROMPARTS ( 2016, 12, 31, 23, 59, 59, 0 ) AS Result; *************************************************************************  DAY/YEAR/MONTH (Transact-SQL) Returns an integer representing the day (day of the month)/year/month of the specified date.  Syntax DAY ( date ) / YEAR ( date ) / MONTH ( date )  Arguments date Is an expression that can be resolved to a time, date, smalldatetime, datetime, datetime2, or datetimeoffset value. The date argument can be an expression, column expression, user-defined variable or string literal.  Return Type Int  Return Value DAY returns the same value as DATEPART (day, date). Same with DATEPART(month,date) and DATEPART(year,date) If date contains only a time part, the return value is 1, the base day. *************************************************************************  EOMONTH (Transact-SQL) Returns the last day of the month that contains the specified date, with an optional offset.  Syntax EOMONTH ( start_date [, month_to_add ] )  Arguments start_date Date expression specifying the date for which to return the last day of the month. month_to_add Optional integer expression specifying the number of months to add to start_date. If this argument is specified, then EOMONTH adds the specified number of months to start_date, and then returns the last day of the month for the resulting date. If this addition overflows the valid range of dates, then an error is raised.  Return Type date
Views: 44 Softtech forum
T-SQL: List of integer numbers and dates in one query, without cursor and stored procedure
 
12:17
WITH DTcounter(NUMB, DT) as ( SELECT ROW_NUMBER() OVER (ORDER BY s1.object_id), dateadd(dd,ROW_NUMBER() OVER (ORDER BY s1.object_id),CURRENT_TIMESTAMP) FROM sys.all_columns as s1 --counter about 9500 CROSS JOIN sys.all_columns as s2 --multiply on another 9500 ) SELECT NUMB, DT FROM DTcounter WHERE NUMB between 1 and 1000 ----------------------------------------------- CREATE TABLE TABLE2 (ORD nvarchar(10), DT datetime, CUSTOMER nvarchar(200), PRODUCT_NAME nvarchar(200), QUANTITY decimal(18,2), PRICE decimal(18,2)) INSERT INTO TABLE2 VALUES ('001','2018-07-01','Customer Apple','TABLE 40x60',50,32.55), ('002','2018-07-02','Customer Orange','TABLE 100x60',10,65.00), ('003','2018-07-02','Customer Apple','CHAIR X1',30,15), ('004','2018-07-03','Customer Orange','CHAIR X2',20,13), ('005','2018-07-03','Customer Melon','PC IBM',10,800), ('006','2018-07-04','Customer Apple','PC HP',10,720.12), ('007','2018-07-04','Customer Orange','PC DELL',8,950), ('011','2018-08-11','Customer Apple','PC DELL',1,320.55), ('012','2018-08-12','Customer Orange','TABLE 100x60',10,25.00), ('013','2018-08-12','Customer Apple','CHAIR X1',30,15), ('014','2018-08-13','Customer Orange','CHAIR X2',50,13), ('015','2018-08-17','Customer Melon','PC IBM',5,800), ('016','2018-08-20','Customer Apple','PC HP',5,720.12), ('017','2018-08-22','Customer Orange','CHAIR X1',8,50), ('021','2018-09-01','Customer Apple','PC LENOVO',3,551), ('022','2018-09-08','Customer Orange','TABLE 200x220',1,250.00), ('023','2018-09-09','Customer Apple','CHAIR X1',30,15), ('024','2018-09-10','Customer Orange','CHAIR X2',50,13), ('025','2018-09-14','Customer Melon','CHAIR X3',90,20), ('026','2018-09-19','Customer Apple','CHAIR X4',5,12.50), ('027','2018-09-28','Customer Melon','CHAIR X1',8,50) GO WITH DTcounter(NUMB, DT) as ( SELECT ROW_NUMBER() OVER (ORDER BY s1.object_id), dateadd(dd,ROW_NUMBER() OVER (ORDER BY s1.object_id),'2018-06-30') FROM sys.all_columns as s1 --counter about 9500 --CROSS JOIN sys.all_columns as s2 --multiply on another 9500 ) SELECT A.DT as Date, isnull(sum(QUANTITY*PRICE),0) AS Amount FROM DTcounter A Left Join TABLE2 B on A.DT =B.DT WHERE NUMB between 1 and 92 GROUP BY A.DT DROP TABLE TABLE2
Views: 308 Alex Dargelis
Tutorial#48 How to use Power function in Oracle SQL Database| Number function in Oracle SQL
 
03:37
The Oracle SQL POWER function returns m raised to the nth power or Numeric Functions - Ceil, Floor, Round, mod, replace, power or How to use Power function in SQL or what is the numeric function oracle SQL database ------------------------------------------------------------------------ Assignment link: https://drive.google.com/open?id=1b50AeTyzAhHchqH1IGrgiu1ybAsMtIDX ------------------------------------------------------------------------------- SQL basics, create table oracle, SQL functions, SQL queries, SQL server, SQL developer installation, Oracle database installation, SQL Statement, OCA, Data Types, Types of data types, SQL Logical Operator, SQL Function,Join- Inner Join, Outer join, right outer join, left outer join, full outer join, self-join, cross join, View, SubQuery, Set Operator. Hi viewer, you might be thinking of the following question so landed at the right place you might get the answer to the following question how to learn sql some good sql tutorial how to find sql basics course, SQL training, SQL practice material, SQL practice online how to master oracle SQL best way to learn/practice oracle SQL best sql tutorial videos good video tutorial on SQL What are the query optimization techniques in Oracle/SQL follow me on: Facebook Page: https://www.facebook.com/LrnWthr-319371861902642/?ref=bookmarks Contacts Email: [email protected] Instagram: https://www.instagram.com/equalconnect/ Twitter: https://twitter.com/LrnWthR
Views: 82 EqualConnect Coach
MS SQL 2012 - How to Fix Error Arithmetic overflow error converting int to data type numeric.avi
 
01:20
http://howtodomssqlcsharpexcelaccess.blogspot.ca/2012/03/ms-sql-2012-how-to-fix-error-arithmetic.html
Views: 5147 Vis Dotnet
CONVERSION FUNCTION IN SQL SERVER 2014 || CAST AND CONVERT FUNCTION IN SQL SERVER 2014
 
04:48
This video will provide you the details of each Conversion functions in SQL Server 2014. I'll be walking through each and every kinds of build in function which are available in SQL Server in my next videos. Conversion Functions :- CAST and CONVERT (Transact-SQL) Converts an expression of one data type to another.  Syntax -- Syntax for CAST: CAST ( expression AS data_type [ ( length ) ] ) -- Syntax for CONVERT: CONVERT ( data_type [ ( length ) ] , expression [ , style ] ) Implicit Conversion Explicit Conversion Implicit Conversion is done automatically Explicit Conversion is done programmatically. In Implicit conversion, no data loss take place during the data conversion. In explicit conversion, data loss may or may not be take place during data conversion. Hence there is a risk of information loss. No possibility of throwing exception during the conversion and therefore is called type safe. It might throw error if tried to do without type casting. Implicit conversion do not require any special syntax. Explicit conversion do require cast operator to perform conversion. Example : Example : Conversion of smaller number to larger number is implicit conversion. Conversion of larger number to smaller number is explicit conversion.  Arguments expression Is any valid expression. data_type Is the target data type. This includes xml, bigint, and sql_variant. Alias data types cannot be used. length Is an optional integer that specifies the length of the target data type. The default value is 30. style Is an integer expression that specifies how the CONVERT function is to translate expression. If style is NULL, NULL is returned. The range is determined by data_type. For more information, see the Remarks section.  Return Types Returns expression translated to data_type.  Remarks • Date and Time Styles When expression is a date or time data type, style can be one of the values shown in the following table. Other values are processed as 0. . Beginning with SQL Server 2012, the only styles that are supported when converting from date and time types to datetimeoffset are 0 or 1. All other conversion styles return error 9809. SQL Server supports the date format in Arabic style by using the Kuwaiti algorithm. Without century (yy) (1) With century (yyyy) Standard Input/Output (3) - 0 or 100 (1,2) Default for datetime and smalldatetime mon dd yyyy hh:miAM (or PM) 1 101 U.S. 1 = mm/dd/yy 101 = mm/dd/yyyy 2 102 ANSI 2 = yy.mm.dd 102 = yyyy.mm.dd 3 103 British/French 3 = dd/mm/yy 103 = dd/mm/yyyy 4 104 German 4 = dd.mm.yy 104 = dd.mm.yyyy 5 105 Italian 5 = dd-mm-yy 105 = dd-mm-yyyy 6 106 (1) - 6 = dd mon yy 106 = dd mon yyyy 7 107 (1) - 7 = Mon dd, yy 107 = Mon dd, yyyy 8 108 - hh:mi:ss - 9 or 109 (1,2) Default + milliseconds mon dd yyyy hh:mi:ss:mmmAM (or PM) 10 110 USA 10 = mm-dd-yy 110 = mm-dd-yyyy 11 111 JAPAN 11 = yy/mm/dd 111 = yyyy/mm/dd 12 112 ISO 12 = yymmdd 112 = yyyymmdd - 13 or 113(1,2) Europe default + milliseconds dd mon yyyy hh:mi:ss:mmm(24h) 14 114 - hh:mi:ss:mmm(24h) - 20 or 120 (2) ODBC canonical yyyy-mm-dd hh:mi:ss(24h) - 21 or 121 (2) ODBC canonical (with milliseconds) default for time, date, datetime2, and datetimeoffset yyyy-mm-dd hh:mi:ss.mmm(24h) - 126 (4) ISO8601 yyyy-mm-ddThh:mi:ss.mmm (no spaces) Note: When the value for milliseconds (mmm) is 0, the millisecond value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'. - 127(6, 7) ISO8601 with time zone Z. yyyy-mm-ddThh:mi:ss.mmmZ (no spaces) Note: When the value for milliseconds (mmm) is 0, the milliseconds value is not displayed. For example, the value '2012-11-07T18:26:20.000 is displayed as '2012-11-07T18:26:20'. - 130 (1,2) Hijri (5) dd mon yyyy hh:mi:ss:mmmAM In this style, mon represents a multi-token Hijri unicode representation of the full month's name. This value will not render correctly on a default US installation of SSMS. - 131 (2) Hijri (5) dd/mm/yyyy hh:mi:ss:mmmAM
Views: 252 Softtech forum
Java default method
 
12:43
In this tutorial we will discuss default methods in Java Interfaces. With Java 8, Oracle introduced several new features like functional programming, lambda expressions etc. There was need to extend already existing interfaces like List and Collection. However, one could not simply add new methods to Java interfaces as most of the existing implementations would break. Hence, default methods were introduced for backward compatibility. Here we learn about the benefits of default methods in Java, and what rules are applicable on them when such interfaces are extended or implemented. Here is the code used in tutorial - public modifier indicates that interface can be used in any other interface or class. default modifier is package public interface ITimeService { void printTime(int hour, int minute, int seconds); void printDate(int day, int month, int year); } public class SimpleTimeService implements ITimeService { @Override public void printTime(int hour, int minute, int seconds) { System.out.println("Time =] " + hour + ":" + minute + ":" + seconds); } @Override public void printDate(int day, int month, int year) { System.out.println("Date =] " + day + "/" + month + "/" + year); } } public class Program { public static void main(String[] args) { ITimeService timeService = new SimpleTimeService(); timeService.printTime(12, 30, 10); timeService.printDate(10, 10, 2017); } } default void printDateTime(int hour, int minute, int seconds, int day, int month, int year) { System.out.println("DateTime =] " + day + "/" + month + "/" + year + " " + hour + ":" + minute + ":" + seconds); } public class AnotherTimeService implements ITimeService { @Override public void printTime(int hour, int minute, int seconds) { System.out.println("Time =] " + hour + "-" + minute + "-" + seconds); } @Override public void printDate(int day, int month, int year) { System.out.println("Date =] " + day + "-" + month + "-" + year); } @Override public void printDateTime(int hour, int minute, int seconds, int day, int month, int year) { System.out.println("DateTime =] " + day + "-" + month + "-" + year + " " + hour + "-" + minute + "-" + seconds); } } ITimeService timeService = new SimpleTimeService(); timeService.printTime(12, 30, 10); timeService.printDate(10, 10, 2017); timeService.printDateTime(12, 30, 10, 10, 10, 2017); ITimeService anotherTimeService = new AnotherTimeService(); anotherTimeService.printTime(12, 30, 10); anotherTimeService.printDate(10, 10, 2017); anotherTimeService.printDateTime(12, 30, 10, 10, 10, 2017);
Views: 4636 kudvenkat