Insert into lubbase (" serial number ", "root", "secondary directory", "three directories", "four directory", "five directory", "level 6 directory" and "part name", "component model", "unit", "the number of installed", "grease type", "filling quantity", "filling unit", "filling date", "filling period (day)", "oil price", "oil price") select "serial number", "root", "secondary directory", "three directories", "four directory", "five directory", "six levels of directory", "part name", "component model", "unit", "the number of installed", "grease type", "filling quantity", "filling unit," Max (" filling date "), "filling period (day)", "oil price", "oil price", the case when dateadd (day, "filling cycle (days)," Max (" filling date ")) & gt;=the convert (date, getdate (), then 'maturity' else 'outstanding' end from lubtable group by "serial number", "root", "secondary directory", "three directories", "four directory", "five directory", "six levels of directory", "part name", "component model";
5000 rows get through it, the card here
CodePudding user response:
Do you select more than one line, behind the oil priceCodePudding user response:
And you this will select an errorCodePudding user response:
1, the original poster that should be SQL SERVER library;2, the problem should be in the group by?
CodePudding user response: