Oracle Academy Conversion Functions.

Slides:



Advertisements
Similar presentations
Prof.Briciu Daniela Sc.cu cls. I-VIII Luna de Sus
Advertisements

Criterii de divizibilitate
Dr. Alexandra I. Cristea CS 252: Fundamentals of Relational Databases: SQL3.
Crearea unei prezentari PowerPoint
Copyright  Oracle Corporation, All rights reserved. 2 Single-Row Functions.
Objectives After completing this lesson, you should be able to do the following: Describe various types of conversion functions that are available in.
Copyright © 2007, Oracle. All rights reserved Using Single-Row Functions to Customize Output Modified: October 21, 2014.
Present Perfect Simple prezentare. Schema de formare: Afirmativ: S + have/has + V(III)/ V(-ed)… Negativ: S + have/has + not + V(III)/ V(-ed)… Interogativ:
SQL functions - numeric and date Speaker notes contain additional information!
3-1 Copyright  Oracle Corporation, All rights reserved. SQL Functions FunctionInput arg 1 arg 2 arg n Function performs action OutputResultvalue.
3 Single-Row Functions. 3-2 Objectives At the end of this lesson, you should be able to: Describe various types of functions available in SQL Use character,
3 Copyright © Oracle Corporation, All rights reserved. Single-Row Functions.
3 Copyright © 2004, Oracle. All rights reserved. Using Single-Row Functions to Customize Output.
Single – Row Functions. Objectives After completing this lesson, you should be able to do the following:  Describe various types of functions available.
Copyright  Oracle Corporation, All rights reserved. 3 Single-Row Functions.
5. Simple SQL using Oracle1 Simple SQL using Oracle 5. Working with Tables: Data management and Retrieval 6. Working with Tables: Functions and Grouping.
6 Copyright © 2006, Oracle. All rights reserved. Using Single-Row Functions to Customize Output.
Conversion Functions.
Single-Row Functions. SQL Functions FunctionInput arg 1 arg 2 arg n Function performs action OutputResultvalue.
5. Simple SQL using Oracle1 Simple SQL using Oracle 5. Working with Tables: Data management and Retrieval 6. Working with Tables: Functions and Grouping.
Copyright  Oracle Corporation, All rights reserved. 3 Single-Row Functions.
3 Copyright © Oracle Corporation, All rights reserved. Single-Row Functions.
Copyright س Oracle Corporation, All rights reserved. 3 Single-Row Functions.
3 Copyright © Oracle Corporation, All rights reserved. Single-Row Functions.
Using Single-Row Functions to Customize Output
3 Copyright © 2007, Oracle. All rights reserved. Substitution Variables ra Oly l&On nase lce Int erU.
Texas State Technical College DISCOVER! Conversion Functions “Convert this!”
+, -, *, / Mathematical operators ABS(value) Returns the absolute value SIGN(value) Returns the sign of a value, such as 1, -1, 0 MOD(value,divisor) Returns.
3 Copyright © 2004, Oracle. All rights reserved. Using Single-Row Functions to Customize Output.
4 Copyright © 2009, Oracle. All rights reserved. Using Conversion Functions and Conditional Expressions.
Ch. 3 Single-Row Functions
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL
CS 3630 Database Design and Implementation
Chapter Nine Data Manipulation Language (DML) Functions
Februarie 2018 ASE Bucuresti
ACTIVITATEA 1 -,, PROFESOR IT LA PAPI’’
Oracle Academy Lead Adjunct
Funcţii Excel definite de utilizator (FDU) în VBA
Instrumente CASE Curs nr. 7.
Căutarea şi regăsirea informaţiei.
SOFTWARE Tipuri de software.
PASII INSTALARII SISTEMULUI DE OPERARE
Time Revision.
CREATE, DROP,ALTER INSERT, UPDATE, DELETE
Căutarea şi regăsirea informaţiei.
Paxos Made Simple Autor: Puşcaş Radu George
Gindeste ……...
CONVERSII INTRE SISTEME DE NUMERATIE
MANAGEMENT EDUCAŢIONAL PERFORMANT Limbajul de programare Borland Pacal
Tipuri structurate Tipul tablou
المحاضرة 4 دوال الصف الواحد.
Web Form BuilDer Coffee Cup.
Curs 6: Introducere în programarea SAS
Totul despre: Valentine’s day.
Formatarea paragrafului
Gindeste ……...
original creator: unknown
Biletul la ordin internațional – explicații
Eclipsele de soare si de luna
Forms (Formulare).
A great way to create a channel of communication
SUBSTANTE PURE SI AMESTECURI DE SUBSTANTE
Functia de documentare
Folosirea de către companii a Twitter, Facebook şi LinkedIn
Gindeste ……...

Software open source in industria software
Harti de imagini, Cadre, Stiluri
Administrare Oracle 9i Suport de curs
Temporal Data Part V.
Presentation transcript:

Oracle Academy Conversion Functions

Conversion Functions

Conversion Functions Date -> Char TO_CHAR (data, 'format') Cuvintele dintre ghilimele in format sunt inserate in sirul afisat exact cum apar Spatiile ce apar informat sunt reproduse in rezultatul afisat fm – elimina spatiile sau zerourile nesemnificative SELECT to_char(sysdate,'dd "din luna" mm "a anului" YYYY') => 10 din luna 03 a anului 2006 SELECT to_char(sysdate,'fmdd "din luna" mm "a anului" YYYY') => 10 din luna 3 a anului 2006

Conversion Functions Date -> Char YYYY Select to_char(sysdate,'dd-mon-YyYy') from dual => 10-mar-2006 YY Select to_char(sysdate,'dd-mon-YY') from dual => 10-mar-06 Y Select to_char(sysdate,'dd-mon-Y') from dual => 10-mar-6 YEAR Select to_char(sysdate,'dd-mon-Year') from dual => 10-mar-Two Thousand Six Select to_char(sysdate,'dd-mon-YEAR') from dual => 10-mar-TWO THOUSAND SIX

Conversion Functions Date -> Char MM Select to_char(sysdate,'dd-mm-YYYY') from dual => 10-03-2006 Select to_char(sysdate,'fmdd-mm-YYYY') from dual => 10-3-2006 MON Select to_char(sysdate,'dd-mon-YYYY') from dual => 10-mar-2006 Select to_char(sysdate,'dd-MON-YYYY') from dual => 10-MAR-2006 Select to_char(sysdate,'dd-Mon-YYYY') from dual => 10-Mar-2006

Conversion Functions Date -> Char MONTH Select to_char(sysdate,'dd-month-YYYY') from dual => 10-march-2006 Select to_char(sysdate,'dd-MONTH-YYYY') from dual => 10-MARCH-2006 Select to_char(sysdate,'dd-Month-YYYY') from dual => 10-March-2006

Conversion Functions Date -> Char SP – se poate combina cu YYY, DD, MM, HH, MI Select to_char(sysdate,'dd-mm-YYYY') from dual => 10-03-2006 Select to_char(sysdate,'ddsp-mm-YYYY') from dual => ten-03-2006 Select to_char(sysdate,'ddspth-mm-YYYY') from dual => tenth-03-2006 Select to_char(sysdate-7,'ddspth-mm-YYYY') from dual => third-03-2006

Conversion Functions Date -> Char DD - ziua din luna (1..31) Select to_char(sysdate,'dd-mm-YYYY') from dual => 10-03-2006 DDth DDTH (the spell is set by DD not the TH) Select to_char(sysdate,'DDth-mm-YYYY') from dual => 10TH-03-2006 Ddth DdTH Select to_char(sysdate,'DdTH-mm-YYYY') from dual => 10Th-03-2006 ddth ddTH Select to_char(sysdate,'ddTH-mm-YYYY') from dual => 10th-03-2006

Conversion Functions Date -> Char D – ziua din saptamana (1..7) Select to_char(sysdate,'d-mm-YYYY') from dual => 6-03-2006 DAY Select to_char(sysdate,'Day, dd-mm-YYYY') from dual => Friday, 10-03-2006 DY – abrevierea cu trei caractere Select to_char(sysdate,'DY, dd-mm-YYYY') from dual => FRI, 10-03-2006 DDD – ziua din an (1..366) Select to_char(sysdate,'ddd "of" YYYY') from dual => 69 of 2006

Conversion Functions Char -> Date TO_DATE('data', 'format') Se folosesc aceleasi formate ca si la TO_CHAR cu urmatoarele restrictii: Nu se pot folosi siruri incluse intre ghilimele: SELECT to_date('10 of March 2006','dd "of" March, YYYY') => eroare! Zilele nu pot fi scrise cu litere, trebuie sa fie numere SELECT to_date('Ten March 2006','Ddsp March, YYYY')

RR and YY format

RR and YY format Select TO_CHAR(TO_DATE('01-01-97','dd-mm-yy'),'YYYY') => Select TO_CHAR(TO_DATE('01-01-97','dd-mm-rr'),'RRR') Select TO_CHAR(TO_DATE('01-01-97','dd-mm-rr'),'YYYY') Select TO_CHAR(TO_DATE('01-01-97','dd-mm-yy'),'RRR')