tags:

views:

25

answers:

1

Is it possible to set a varaible to a query result such as:

DECLARE result INT;

SET result = (SELECT index FROM table WHERE data = 'xxxx' LIMIT 1);

Assuming of course you know that there will only be one result set

+1  A: 

only within a procedure.

longneck