Search
 
SCRIPT & CODE EXAMPLE
 

SQL

SQL Integer devision

-- When performing division operations on integer values, 
-- the results will always be integers and the results 
-- may not always be what you expect.

SELECT 1 / 2; --> Result: 0
SELECT 1.0 / 2; --> Result: 0.5
SELECT CAST(1 AS REAL) / 2; --> Result: 0.5
SELECT 17 / 5; --> Result: 3
SELECT 17 % 5; --> Result: 2

-- Remember, these are integers and so the result will 
-- be an integer and 1.0 is not an integer.
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql get random row 
Sql :: extract month from date sql two digits 
Sql :: mysql delete last row 
Sql :: mysql dump mysql db cli 
Sql :: postgresql create table with index 
Sql :: mysql get first 2 characters of string 
Sql :: current setting postgres timezone 
Sql :: mysql delete binlog 
Sql :: postgres killing connections on db 
Sql :: mysql add column default value 
Sql :: Odoo Service is not coming up with postgresql read replica (slave) 
Sql :: installing mysql on fedora 
Sql :: vagrant mysql downgrade version 
Sql :: oracle kill session by sql_id 
Sql :: pentaho + pasar de excel a sql 
Sql :: hibernate with springboot mysql 
Sql :: install mysql in amazon linux 2 
Sql :: sql select column names 
Sql :: mysql cli connect with password 
Sql :: create column mysql terminal 
Sql :: create database store 
Sql :: how to change owner in postgres 
Sql :: mysql best varchar length size 
Sql :: oracle current sequence value 
Sql :: sql fill na with 0 
Sql :: varchar plsql 
Sql :: host is not allowed to connect to this mysql server 
Sql :: sql empty table 
Sql :: ubuntu install postgresql 12 
Sql :: best sql course 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =