Surround that select with parentheses.
SET @v1 := (SELECT COUNT(*) FROM user_rating);
SELECT @v1;
More Related Contents:
- How can I simulate an array variable in MySQL?
- ‘IF’ in ‘SELECT’ statement – choose output value based on column values
- 1052: Column ‘id’ in field list is ambiguous
- How to do a batch insert in MySQL
- Count the occurrences of DISTINCT values
- Codeigniter – multiple database connections
- What’s the difference between ” = null” and ” IS NULL”?
- JOIN queries vs multiple queries
- Is the primary key automatically indexed in MySQL?
- Storing Data in MySQL as JSON
- MySql: MyISAM vs. Inno DB! [closed]
- MySQL: Cloning a MySQL database on the same MySql instance
- DOs and DONTs for Indexes [closed]
- How to change the default port of mysql from 3306 to 3360
- How to insert images from database?
- Is there an SQLite equivalent to MySQL’s DESCRIBE [table]?
- mySQL – Create a New Table Using Data and Columns from Three Tables
- When to use MyISAM and InnoDB? [duplicate]
- Alternative to using LIMIT keyword in a SubQuery in MYSQL
- How to insert a file in MySQL database?
- How do I rename a MySQL database (change schema name)?
- Foreign key to one of many tables?
- Find date range overlaps within the same table, for specific user MySQL
- Rename a table in MySQL
- What’s the recommended way to connect to MySQL from Go? [closed]
- What is the best way to do incremental backups in MySQL?
- #1130 – Host ‘localhost’ is not allowed to connect to this MySQL server
- How to Get True Size of MySQL Database?
- Put MySQL database under version control?
- MySQL: Computed Column