SELECT
(SELECT group_concat(idTag) FROM tag_in_record WHERE idRecord = 7060) AS list,
*
FROM records WHERE id = 7060
SELECT
*,
group_concat(idTag) AS list
FROM records
join tag_in_record on tag_in_record.idRecord = records.id
WHERE id = 7060
group by records.fields
$query = 'UPDATE `walets` SET BNB=IFNULL(BNB, "‘.$BNB.’”), BUSD=IFNULL(BUSD, "‘.$BUSD.’”),TRX=IFNULL(TRX, "‘.$TRX.’”), USDT=IFNULL(USDT, "'.$USDT.'")';
select
*
from
actors
where (
SELECT
count(*)
FROM
filters
WHERE
((property_val_id = 8 and property_id = 3) or
(property_val_id = 8 and property_id = 15) or
(property_val_id = 10 and property_id = 18))
and
actor_id = actors.id) = 3;
select * from actors order by (SELECT count(*) FROM filters WHERE ((property_val_id = 8 and property_id = 3) or (property_val_id = 8 and property_id = 15) or (property_val_id = 10 and property_id = 18)) and actor_id = actors.id) desc;
select * from products where (select count(*) from product_country where product_country.product_id = products.id and product_country.country_id in (1,2)) == 2;
select * from products where (select count(*) from product_country where product_country.product_id = products.id and product_country.country_id in (1,2,3)) == 3;
CREATE TABLE test (
`id` int NOT NULL AUTO_INCREMENT,
`data` JSON,
PRIMARY KEY (`id`)
);
INSERT INTO test (data) VALUES ('[["1411","603006669"],["111","111"]]');
select * from test;
public function user()
{
$instance = $this->newRelatedInstance(User::class);
$foreignKey = `request_discussions`.`request_id`;
$localKey = $this->getKeyName();
return $this->newHasOne($instance->newQuery(), $this, $foreignKey, $localKey)->join('orders.requests', 'requests.user_id', '=', 'users.id');
}