hown; Mysql > SELECT a, b FROM my_table; 1 row in set result of this query?

Consider the my_table table with two integer columns, a and b, and the contents as shown;
Mysql > SELECT a, b FROM my_table;

1 row in set result of this query?
SELECT a—b
FROM my_table;

Consider the my_table table with two integer columns, a and b, and the contents as shown;
Mysql > SELECT a, b FROM my_table;

1 row in set result of this query?
SELECT a—b
FROM my_table;

A.
0

B.
2

C.
4

D.
An error message



Leave a Reply 7

Your email address will not be published. Required fields are marked *


swdx

swdx

It’s C.

a-(-b) = a + b.

Ray

Ray

if the question contains double minus, the answer is C otherwise A.

420

420

but remember that — is also a comment. So if there is space between ‘–‘ and ‘b’, from the comment to the end of the line everything will be treated as a comment. Just in case 😀

Steve

Steve

Double dash with space is comment