Home > database >  Use of function
Use of function

Time:11-07


This function can be used in the select, insert is not line, bosses, this is why, mysql5.7

CodePudding user response:

This is a custom function

CodePudding user response:

You put the fifth line, SET at the beginning of the line, copy to the front of the INSERT, performs this paragraph,
Is the first SET, and then perform INSERT,

CodePudding user response:

Upstairs should be positive solution, not because an error function, but a variable,

CodePudding user response:

refer to the second floor AHUA1001 response:
you the fifth line, SET at the beginning of the line, copy to the front of the INSERT, performs this paragraph,
Is SET first, and then perform INSERT,
I only put the date in front, in order to compare the modified or not
DROP TABLE IF the EXISTS tmp_product;
CREATE TEMPORARY TABLE tmp_product (
Productid VARCHAR (40),
Hottype int);

The set @ todate='2019-08-26';
INSERT into tmp_product
The SELECT product_id, fn_saleshottype_V3 (@ todate, product_id) FROM ads_productdaliy_report;
- where right (statisticalmonth, 2)=month (@ todate);

Select * FROM tmp_product;

CodePudding user response:

You put all behind the INSERT @ todate, try all into '2019-08-26',

CodePudding user response:

reference 5 floor AHUA1001 reply:
you put all behind the INSERT @ todate, try all into '2019-08-26',

Or no, remove the insert, whether with @ todate or '2019-08-26' is no problem, as long as the insert is not
  • Related