[PrestaShopDatabaseException]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SORT BY RAND ) LIMIT 1' at line 14SELECT COUNT(DISTINCT p.`id_product`) AS nb FROM `ps_product` p INNER JOIN ps_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 2) WHERE product_shop.`active` = 1 AND product_shop.`show_price` = 1 AND product_shop.`visibility` IN ("both", "catalog") AND p.`id_product` IN(71, 128, 234, 286, 289, 58, 313, 260, 259, 258, 325, 326, 331, 97, 304, 305, 308, 181, 174, 180, 230, 187, 232, 261, 262, 35, 39, 201, 311, 319, 317, 320, 314, 312, 309, 265, 223, 216, 217, 215, 225, 224, 221, 219, 218, 220, 226, 222, 272, 273, 299, 298, 301, 300, 302, 283, 931, 285, 280, 358, 359, 281, 360, 361, 362, 363, 364, 365, 366, 197, 53, 190, 188, 194, 193, 172, 154, 155, 171, 378, 379, 380, 169, 170, 385, 386, 387, 388, 73, 185, 391, 393, 291, 199, 397, 398, 399, 402, 404, 405, 406, 407, 410, 408, 200, 70, 417, 418, 420, 421, 422, 423, 424, 233, 425, 426, 427, 428, 429, 431, 434, 435, 436, 437, 438, 440, 441, 442, 443, 433, 930, 752, 753, 889, 776, 777, 778, 890, 891, 757, 710, 711, 801, 802, 870, 872, 697, 701, 698, 699, 722, 874, 729, 730, 731, 944, 790, 828, 795, 1144, 907, 908, 909, 910, 911, 912, 918, 919, 920, 922, 924, 925, 926, 927, 928, 929, 932, 933, 934, 935, 936, 937, 779, 780, 692, 691, 750, 864, 885, 672, 748, 670, 671, 898, 897, 736, 809, 841, 879, 842, 857, 683, 868, 767, 814, 708, 735, 798, 764, 848, 894, 703, 704, 705, 706, 712, 707, 717, 718, 719, 723, 797, 1040, 1047, 694, 695, 664, 1108, 1107, 1106, 1105, 962, 963, 964, 965, 966, 967, 968, 1006, 1071, 1073, 1072, 1042, 1043, 1046, 1045, 1070, 1067, 1069, 1068, 1044, 1074, 1075, 1082, 1083, 1099, 1100, 1101, 1102, 1103, 1104, 975, 976, 977, 978, 1009, 1010, 1053, 1052, 1051, 992, 993, 1115, 1029, 679, 1146, 1138, 1227, 1219, 1221, 1177, 1145, 1206, 1174, 1264, 1265, 1263, 950, 1133, 1149, 1210, 1137, 1152, 1151, 1160, 1159, 1222, 1116, 1117, 1118, 1240, 1214, 1239, 1238, 981, 982, 983, 1039, 1154, 1155, 1268, 1181, 738, 649, 1176, 1223, 1242, 1244, 1164, 1270, 1209, 971, 970, 761, 762, 651, 666, 669, 678, 684, 713, 715, 727, 743, 760, 765, 766, 821, 822, 1310, 843, 861, 869, 939, 938, 973, 996, 1023, 1036, 1056, 1080, 1077, 1079, 1078, 1081, 1169, 1189, 1188, 1094, 1095, 1249, 1187, 1237, 789, 793, 796, 1272, 1273, 1241, 759, 1066, 986, 1172, 1173, 1110, 1171, 689, 807, 847, 954, 956, 955, 958, 957, 1248, 1247, 1233, 1232, 1230, 1215, 1216, 1217, 1218, 1212, 1213, 1129, 1122, 1124, 1123, 1130, 1090, 1011, 1014, 1012, 1015, 1016, 1017, 1048, 1027, 1049, 1058, 1057, 1112, 1114, 1113, 1121, 1120, 1119, 953, 1163, 1166, 1229, 1131, 1132, 1125, 1245, 1246, 1186, 1231, 1220, 1274, 1275, 816, 994, 846, 990, 991, 1308, 1296, 1356, 1359, 1312, 1311, 1203, 1204, 1167, 1299, 655, 1224, 1305, 1041, 662, 1168, 1007, 1008, 1050, 987, 988, 1018, 999, 969, 1061, 1062, 827, 1064, 1065, 1054, 1055, 1109, 995, 974, 1192, 985, 1185, 979, 980, 1111, 997, 1162, 1161, 1278, 1157, 1158, 1234, 1059, 1147, 1156, 1148, 1191, 1190, 680, 1025, 681, 690, 763, 1020, 1235, 1236, 989, 696, 896, 688, 895, 815, 823, 824, 1028, 849, 850, 813, 677, 1026, 758, 820, 768, 817, 818, 947, 851, 852, 826, 1019, 819, 1021, 1022, 1076, 1085, 1086, 1087, 1088, 1324, 1325, 1326, 1271, 1175, 1309, 1228, 1211, 1182, 1184, 1183, 1376, 1377, 772, 771, 853, 854, 1333, 1332, 1035, 1033, 1032, 1031, 1030, 1336, 1335, 792, 791, 873, 837, 1345, 1346, 1348, 1347, 1038, 1386, 1453, 1454, 1455, 1456, 1400, 1401, 1452, 860, 859, 667, 1304, 1303, 1465, 1355, 682, 746, 749, 1393, 1394, 1395, 1153, 1136, 1165, 1127, 1128, 1143, 1141, 1142, 1139, 663, 1208, 948, 668, 961, 751, 863, 951, 960, 959, 1004, 1005, 1001, 1024, 1353, 1357, 1358, 1198, 1385, 1380, 1375, 1344, 1340, 1315, 1314, 1313, 1307, 799, 700, 702, 652, 709, 725, 733, 794, 1337, 1338, 1339, 732, 1349, 1350, 1381, 1390, 1391, 1392, 1321, 1416, 1415, 1368, 1369, 1370, 1371, 832, 1316, 1323, 1322, 716, 1000, 653, 721, 724, 726, 786, 787, 788, 728, 800, 829, 830, 831, 834, 836, 835, 871, 650, 876, 942, 943, 949, 833, 1317, 1201, 1492, 1493, 1494, 1504, 1583, 1582) AND p.`id_product` IN ( SELECT cp.`id_product` FROM `ps_category_group` cg LEFT JOIN `ps_category_product` cp ON (cp.`id_category` = cg.`id_category`) WHERE cg.`id_group` = 1 SORT BY RAND ) LIMIT 1
at line 605 in file classes/db/Db.php

599. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
600. 		}
601. 		else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
602. 		{
603. 			if ($sql)
604. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
605. 			throw new PrestaShopDatabaseException($this->getMsgError());
606. 		}
607. 	}
608. 
609. 	/**