About 6,860,000 results
Open links in new tab
  1. sql - MySQL Insert Cast - Stack Overflow

    Sep 29, 2014 · I have tried to Insert a value into a table in MySQL but I can't make it work. I am using the following queries: INSERT into articulo values (32,'Sala',CAST('$10,000.45999' AS DECIMAL(10,5)),40.2399,200.2399,3,'kid 3');

  2. MySQL | CAST( ) Function - GeeksforGeeks

    May 12, 2023 · The MySQL CAST() function is used for converting a value from one datatype to another specific datatype. The CAST() function accepts two parameters which are the value to be converted and the datatype to which the value needs to be converted.

  3. MySQL CAST() Function - W3Schools

    Aug 29, 2017 · The CAST() function converts a value (of any type) into the specified datatype. Tip: See also the CONVERT() function. Syntax

  4. mysql - Using CAST with an insert into ... select - Stack Overflow

    SELECT CASE WHEN columnA = '' THEN 0 ELSE CAST(columnA AS decimal(7,2)) END FROM src; SELECT IF(columnA <> '', CAST(columnA AS decimal(7,2)), 0) FROM src; Or use 2 SELECTs with UNION ALL: SELECT CAST(columnA AS decimal(7,2)) FROM src WHERE columnA <> '' UNION ALL SELECT 0 FROM src WHERE columnA = '';

  5. sql - MySQL Workbench: Using the CAST function to return date …

    Mar 2, 2020 · For the following SQL query: SELECT OrderDate, CAST(OrderDate AS data(YY:MM:DD:HH:MM:SS)) AS 'Order - full date and time', CAST(OrderDate AS data(YY:MM)) AS 'Order - year and month', ...

  6. MySQL :: MySQL 9.3 Reference Manual :: 14.10 Cast Functions

    For a string which evaluates to 0, return 2000. For the number 0, return 0. For a DATE, DATETIME, or TIMESTAMP value, return the YEAR portion of the value. For a TIME value, return the current year.. If you do not specify the type of a TIME argument, you may get a different result from what you expect, as shown here:

  7. MySQL CAST Function - MySQL Tutorial

    This tutorial shows you how to use MySQL CAST function to convert a value of any type into a value with a specified type.

  8. How to Effectively Use MySQL's CAST Function to Convert Data …

    Feb 19, 2025 · By using the CAST function to convert these values into integers, you can execute your calculations accurately. In this SQL statement, the CAST function converts the sales column from a string type to an unsigned integer type, ensuring that the …

  9. MySQL CAST Function with Examples - Dot Net Tutorials

    The MySQL CAST function is used to convert a value or expression from one data type to another data type. The changing of one data type to another data type is known as casting. The casting is very useful while importing or exporting the data. It is …

  10. MySQL CAST() - StackHowTo

    Jan 8, 2022 · The syntax of the CAST() function is as follows: SELECT CAST( expression AS type ); In this syntax, “expression” refers to the value to be converted, while “type” contains the type of data to be obtained.

  11. Some results have been removed
Refresh