是否有更好/更短的方法来做到这一点?
每个变量都是一个被调用的MySQL表值.我有一个主表和一个覆盖表,所以调用第一个表,提取结果数组,然后调用覆盖表并提取这些结果以覆盖第一个提取.
if (isset($Price1)){
$AllPrices[] = $Price1;}
if (isset($Price2)){
$AllPrices[] = $Price2;}
if (isset($Price3)){
$AllPrices[] = $Price3;}
if (isset($Price4)){
$AllPrices[] = $Price4;}
if (isset($SPrice1)){
$AllPrices[] = $SPrice1;}
if (isset($SPrice2)){
$AllPrices[] = $SPrice2;}
if (isset($SPrice3)){
$AllPrices[] = $SPrice3;}
Run Code Online (Sandbox Code Playgroud) 我正在尝试查找、计算和报告列中重复条目的所有实例。任何想法如何做到这一点类似于我在下面的尝试。
SELECT `Id`, COUNT(*) AS `COUNT`
FROM `testproductdata`
WHERE `COUNT` > 1
GROUP BY `Id`
ORDER BY `COUNT` DESC;
Run Code Online (Sandbox Code Playgroud)
我收到 1054 错误:COUNTwhere 子句中的未知列。