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 :: get into database psql 
Sql :: select columns from 2 tables with foreign key 
Sql :: get substract count sql 
Sql :: postgres drop type 
Sql :: hyphen error in database mysql 
Sql :: fatal error uncaught mysqli_sql_exception 
Sql :: sql queries practice 
Sql :: sql division operator 
Sql :: _ Wildcard in SQL 
Sql :: joining tables in sql 
Sql :: sql stored procedure output parameters 
Sql :: sql server port number 
Sql :: what is like operator in sql 
Sql :: update or insert sql 
Sql :: mysql_union 
Sql :: oracle select into and inner join 
Sql :: select limit ms sql 
Sql :: aliasing in sql 
Sql :: if mysql UPDATE 
Sql :: mysql workbench reset performance reports 
Sql :: 000webhost database values insert 
Sql :: how to list all values of a column that start with a letter in sql 
Sql :: mysql set session timeout 
Sql :: sql trigger difference between for and after 
Sql :: select all column 
Sql :: how to run parallel queries in sql server with entity framework 
Sql :: tornado_mysql 
Sql :: multiple row join 
Sql :: how to know which table has more data oracle sql 
Sql :: não é possível executar uma operação DML dentro de uma consulta 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =