What does
SELECt 2 type, c.*, p.name
FROM customer c
LEFT JOIN product p ON (c.id = p.cid) WHERE c.id='5'
GROUP BY p.name
return?
What does the 2 in the statement represent
What does
SELECt 2 type, c.*, p.name
FROM customer c
LEFT JOIN product p ON (c.id = p.cid) WHERE c.id='5'
GROUP BY p.name
return?
What does the 2 in the statement represent
It just adds an additional column to the result set before other columns. The value of this column is always 2. And a type
alias is given to it.