Tutorial by Examples

Here are some ways to set variables: You can set a variable to a specific, string, number, date using SET EX: SET @var_string = 'my_var'; SET @var_num = '2' SET @var_date = '2015-07-20'; you can set a variable to be the result of a select statement using := EX: Select @var := '123'; (...
Let's say we have a table team_person as below: +======+===========+ | team | person | +======+===========+ | A | John | +------+-----------+ | B | Smith | +------+-----------+ | A | Walter | +------+-----------+ | A | Louis | +------+-----------+ | C | ...

Page 1 of 1