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 :: sql server phone constraint 
Sql :: SQL query to verify the size of the table 
Sql :: orcale index size 
Sql :: grant all privileges microsoft sql 
Sql :: select top 3 sql 
Sql :: how to change db owner postgres 
Sql :: mysql order by 
Sql :: allow null in psql 
Sql :: postgres update single column 
Sql :: python dictionary to sql update 
Sql :: sql sum show 0 result 
Sql :: create table with index mysql 
Sql :: query to find object dependencies in oracle 
Sql :: sql time format 
Sql :: mysql select date from datetime 
Sql :: Query to remove duplicate rows from a table 
Sql :: alter table primary key postgresql 
Sql :: using minus query in SQL 
Sql :: sqlite3 update select 
Sql :: mysqldump database 
Sql :: full join sql 
Sql :: SQL Syntax of LEFT JOIN 
Sql :: oracle show parameter 
Sql :: mac django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient? 
Sql :: mysql query where in 
Sql :: find log file postgresql linux 
Sql :: sub query postgres 
Sql :: mysql GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 
Sql :: postgresql escape single quote 
Sql :: oracle gather table statistics 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =