How to use case expression?
Answer / Km.priti
To use CASE expressions in MySQL, you can write a conditional statement that evaluates multiple conditions and returns different results for each condition. Here's an example:n`nSELECT COLUMN_NAME,ntCASEntWHEN data_type = 'int' THEN 'integer'ntWHEN data_type = 'varchar' THEN 'string'ntELSE 'other type'ntEND AS DataType FROM information_schema.columns WHERE table_name='YourTable';n`
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain MySQL optimization?
What is the difference between char and varchar in mysql?
How many ways we can we find the current date using MySQL?
Difference between CHAR and VARCHAR?
Can we store files in mysql?
What is default password for mysql?
How do I create a stored procedure in mysql?
Write command to import an mysql file?
How to use in conditions?
How you will Show unique records.
What are the 3 main types of search queries?
Is microsoft sql same as mysql?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)