Follow us: Connect on YouTube Connect on YouTube Connect on YouTube

Pages

Thursday, 31 March 2016

SQL-Sqrt


This will give the square root of the given value.

     Syntax:   
                   sqrt (value)      --  here value must be positive.

     Ex:
          SQL> select sqrt(4), sqrt(0), sqrt(null), sqrt(1) from dual;

                             SQRT(4)    SQRT(0) SQRT(NULL)    SQRT(1)
----------    ---------- ---------------         ----------
                                    2               0               1                    1

You May Like                                             
                            SQL Abs
                            SQL Sign                           
                            SQL Mod
                            SQL NVL
                            SQL NVL2
                            SQL Power
                            SQL Exp
                            SQL Ln
                            SQL Log
                            SQL CEIL
                            SQL Floor
                            SQL Round
                            SQL Trunc
                            SQL Bitand
                            SQL Greatest
                            SQL Least
                            SQL Coalesce


Share this article :

2 comments:

  1. Salve

    Seems like I won the lottery here….This is a treasure box of blogs and your folks are like leprechauns! Phenomenal read on #topic!

    I'd like to be able to log all constraint errors when users are running an application having Oracle as the back-end. That means inserting a record into an Errors Log table in Oracle.

    Is that even possible? In an exception clause, I could do that; however, when a constraint fails, I don't know where I'd be able to run such code to do the insert.

    Is this even possible?

    Thanks for any help you can give.

    Wayne

    Appreciate your effort for making such useful blogs and helping the community.

    Merci

    ReplyDelete
  2. Hello Mate,


    The sense of praise that I have found for you after reading SQL-Sqrt is overwhelming! Such a tremendous read!

    i need help

    I have 3 tables, the first 2 tables already have values, this is the output

    SQL> select * from tblhorario
    2 ;

    IDHORARIO DESCRIPCIONHORARIO
    ---------- -----------------------
    1 L-V Oficina
    2 L-S Oficina
    3 L-S Extendido
    4 L-S Completo
    5 247

    SQL> select * from tblciudad;

    IDCIUDAD NOMBRECIUDAD
    ---------- -----------------------
    1 Bogota
    2 Cali
    3 Medellin
    4 Bucaramanga
    5 Cartagena
    6 Barranquilla
    7 Cucuta

    7 rows selected.

    For the thir table i need to insert data using a mix of sources:

    First from the normal keyboard input, and second a select query that brings me the fileds DESCRIPCIONHORARIO and NOMBRECIUDAD using the respective ID´S from the other 2 tables. I'm an student and i need help with this.

    This is the original query

    INSERT INTO tblLocal(nombreLocal, direccionLocal, telefono1Local, telefono2Local, celularLocal, emailLocal, renta, idHorario, idCiudad)
    VALUES('UTadeoLozano', 'Cra 5 calle 22', '2756456', 'N/A', '3107770900', 'lutadeo@printing.com', 675000, 1, 1);

    The last numerical values at the and of the clause are meant to come from the two original tables.

    If the solution is a trigger or a stored procedure, please help me.







    By the way do you have any YouTube videos, would love to watch it. I would like to connect you on LinkedIn, great to have experts like you in my connection (In case, if you don’t have any issues).


    Best Regards,
    Radhey

    ReplyDelete