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

Pages

Friday, 1 April 2016

SQL-Floor


This will produce a whole number that is less than or equal to the specified value.

     Syntax: floor (value)   

     Ex:
          SQL> select floor(5), floor(5.1), floor(-5), floor( -5.1), floor(0), floor(null) from dual;

   FLOOR(5) FLOOR(5.1)  FLOOR(-5) FLOOR(-5.1)   FLOOR(0) FLOOR(NULL)
-----------  -------------   ------------  --------------    -----------  ----------------

         5               5                 -5                 -6                   0


You May Like                                             
                            SQL Abs
                            SQL Sign
                            SQL Sqrt
                            SQL Mod
                            SQL NVL
                            SQL NVL2
                            SQL Power
                            SQL Exp
                            SQL Ln
                            SQL Log
                            SQL CEIL                           
                            SQL Round
                            SQL Trunc
                            SQL Bitand
                            SQL Greatest
                            SQL Least
                            SQL Coalesce
 
Share this article :

3 comments:

  1. Halo,


    Gratitude for putting up this prolific article! You truly make everything a cake walk. Genuinely good stuff, saving time and energy.

    I have an MS SQL Server 2012 database on a remote server, and since moving to a new laptop, I have been unable to connect to the database using SQL Server Management Studio 2012. I'm pretty sure this has something to do with my local machine, as I have never had a problem before. I installed SQL Server 2012 and SQL Management Studio 2012, and both seem to be working ok. I can connect to the local SQL database using management Studio, however when I try to connect to my remote database, I'm getting the following error:
    Cannot connect to 104.238.72.41.\MSSQLSERVER2012
    A network-related or instance-specific error.... error: 26 - Error Locating Server/Instance Specified).
    I have checked that SQL server is running locally, and allowed ports 1433 and 1434 through my firewall. I've checked and double-checked the servername and login details. The online application which connects to the database (www.conservationneeds.org) is not experiencing any problems.

    Once again thanks for your tutorial.


    Obrigado,

    ReplyDelete
  2. Hi Bro,


    What you’re saying is absolutely correct #topic, but this isn’t the exact situation everywhere. Where most smart folk work on a project - why can’t you do this the Boss asks :).


    from foll. select, how can i get unique values for screen_type and screen

    select a.EMP_NO,a.SCREEN, b.SCREEN_TYPE
    from EMPLOYEE_TAB a, SCREEN_TAB b
    where a.id = b.ID
    and SCREEN_TYPE like '%S';

    EMP_ID SCREEN SCREEN_TYPE
    EMP_123 SCR100 SCRTYPE100S
    EMP_124 SCR100 SCRTYPE100S
    EMP_125 SCR100 SCRTYPE100S
    EMP_127 SCR102 SCRTYPE102S
    EMP_128 SCR102 SCRTYPE102S
    EMP_135 SCR102 SCRTYPE102S
    EMP_136 SCR102 SCRTYPE102Sv


    THANK YOU!! This saved my butt today, I’m immensely grateful.


    Gracias

    ReplyDelete
  3. Halo,


    Fully agree on SQL-Floor. We’re seeing a lot of projects tackle big complex problems but few seem to have taken into consideration and in particular reasons to adopt.

    My table column type is clob. Field value contain double quotes

    id,text_clob,date

    1,"\"data1\",0,1,1,1,\"data2\"","2018-03-03 09:08:45"

    can you kindly help loader query. i cant use replace in clob field.

    It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
    Keep up the good work!



    Thank you,
    Radhey

    ReplyDelete