G
(1,2)
(1,3)
(1,4)?
Size: a a a
G
G
РW
G
РW
РW
РW
DEAL_ID есть набор DEAL_FIELD_ID
1,1РW
РW
DEAL_FIELD_VALUE при одинаковых парах DEAL_ID и DEAL_FIELD_IDG
s
SELECT
id,
name,
photo,
about,
rules,
private,
type,
count_members as full_count_members,
(SELECT u.id,
((6372 * 2 * ASIN(SQRT(POWER
(SIN((50.450001 - u.lat) * pi() / 180 / 2), 2) +
COS(50.450001 * pi() / 180) * COS(u.lat * pi() / 180) *
POWER(SIN((30.523333 - u.lng) * pi() / 180 / 2), 2))
)) * 1000) AS distance
FROM tbl_groups g
JOIN tbl_users_groups_relations gc on gc.group_id = g.id
JOIN tbl_user u on u.id = gc.user_id
WHERE g.id = tbl_groups.id
AND u.is_delete = '0'
AND u.deleted_at IS NULL
HAVING (distance between 0 AND 200000)) as count_member,
IF(type = 'Spec',
CONCAT('constant.group_icon', icon),
icon
) as icon,
CONCAT('group_image/', photo) as photo,
CONCAT('group_image_imagekit/', photo) as photo_imagekit
FROM tbl_groups
WHERE type IN ('All')
AND type != 'Gym'
ORDER BY name
G
G
РW
Deals (id, select_type, table, partitions, type, possible_keys, key, key_len, ref, rows, filtered, Extra) VALUES (1, 'SIMPLE', 'd', NULL, 'ALL', NULL, NULL, NULL, NULL, 1559456, 100.00, 'Using temporary; Using filesort');Deals (id, select_type, table, partitions, type, possible_keys, key, key_len, ref, rows, filtered, Extra) VALUES (1, 'SIMPLE', 'df', NULL, 'ref', 'DEAL_ID_DEAL_FIELD_ID,DealsFields_DEAL_ID_index,DealsFields_DEAL_FIELD_ID_index,dealsfields_idx_deal_id_deal_id,DEAL_ID_DEAL_FIELD_ID_index', 'DEAL_ID_DEAL_FIELD_ID', '5', 'tovarkas_xxx.d.DEAL_ID', 19, 100.00, 'Using where');РW
G
РW