adspace


How to use case expression?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which statement is used in a select query for partial matching?

1247


How to Change a users password from unix shell.

1222


What is current version of mysql?

1083


What is the current mysql version?

1104