Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)

I'm having some procedures where I want to get some sort of acknowledgement after a condition has been assessed.

For example, the pseudocode would be like,

if ( select count(*) from assgn to where eid = 1 )  > 5
  print " the total number of projects employee working is more than 5 "
else
  insert the value into the assgnto table  

How could I do it in MySQL?

1 Answer

0 votes
by (12.7k points)

If you don't want the text twice as the column heading as well as value, use the following statement.

SELECT 'some text' as '';

Example:

mysql>SELECT 'some text' as '';

+-----------+

|           |

+-----------+

| some text |

+-----------+

1 row in set (0.00 sec)

Want to be a SQL expert? Come and join this SQL Certification course by Intellipaat.

You can check out the below MySQL Tutorial video for better understanding.

Related questions

0 votes
1 answer
asked Dec 6, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...