Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Обучение для смены профессии, роста в карьере и саморазвития
select *, ROW_NUMBER() OVER (PARTITION BY ForeignKey ORDER BY Datetime DESC) as RowNum from table where RowNum = 1
select t1.*, t2.*, t3.* from mainTable t1 inner join mainTable_table1 t2 on t2.id_mainTable = t1.id_mainTable inner join table1 t3 on t3.id_table1 = t2.id_table1
SELECT NOW();
SELECT t1.*, t2.ban_type, t2.w_site FROM `betaintranet`.`ad_stat_cleaned` t1 LEFT JOIN `ad_c` t2 ON t1.bid = t2.bid WHERE t1.`date` = '2020-09-09'
public function getFioAttribute() { return $this->firstname . " " . $this->lastname; }
$model->fio;
UPDATE `modx_site_content` t1 SET t1.`longtitle` = REPLACE(`longtitle`, ' ? ', ( select t2.* from ( select 'a' union select 'b' union select 'c' ) t2 order by rand() limit 1 ) );
select stars_id, sum(val) from my_table group by stars_id
foreach ($countryN as $country) { echo $country['country_name']; }
select username, sum(Amount1 + Amount2 + Amount3) as total from my_table group by username order by total desc limit 20