Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql cast

-- Specifically for Oracle

-- EXAMPLE
CAST('732.98' AS INT)

/* SYNTAX
CAST(<value_to_cast> AS <data_type_to_cast_to>)
*/
Comment

cast in sql

SELECT CAST(25.65 AS int); -- Result : 25
SELECT CAST(25.65 AS int); -- Result : 25
SELECT CAST('25.65' AS decimal(10,2)); -- Result : 25.65 
SELECT CONVERT(VARCHAR(20), 10) -- Result :10
SELECT CONVERT(NVARCHAR(20), 10) -- Result :10 
select convert(varchar, getdate(), 1); -- Result : mm/dd/yyyy
Comment

cast in sql server

-- For Sql server
SELECT CAST(25.65 AS int);
/*
CAST(<value_to_cast> AS <data_type_to_cast_to>)
*/
Comment

PREVIOUS NEXT
Code Example
Sql :: add column postgresql 
Sql :: postgress if 
Sql :: mysql create pool 
Sql :: export database sql file from xampp using cmd 
Sql :: fk in insert mysql 
Sql :: SQL Server OPENQUERY WITH result SETS 
Sql :: Split JSON data in SQL Server column 
Sql :: mysql dump 
Sql :: sql server set default value equal to auto increment 
Sql :: mssql remove duplicate rows 
Sql :: creating sql table 
Sql :: how to start with sql 
Sql :: wamp server mysql password 
Sql :: sql drop all tables 
Sql :: select count distinct multiple columns sql server 
Sql :: sql server find all referencing objects to user-defined table type 
Sql :: mysqldump devilbox 
Sql :: select count concat string sql server 
Sql :: how to do an average on a count sql 
Sql :: mysql check all tables 
Sql :: sql order of execution 
Sql :: create table kusto 
Sql :: tablo silme SQL 
Sql :: mysql varchar length 
Sql :: reindex mssql table 
Sql :: database stuck at restoring state 
Sql :: drop procedure postgres 
Sql :: less than and between in sql query 
Sql :: What is SQL data store? 
Sql :: foreign key sql 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =