我需要按n整数序列找到子序列的最大乘积.我正在寻找一种算法,不一定表示为代码.
例:
我已经完成了算法O(n²),但现在我需要一个算法O(n).
我知道这是可能的.
怎么办O(n)呢?
我将我的数据库的一些表移动到了另一台服务器的流量有问题,并且不想使用联合表有很多原因(性能是主要原因).所以我必须在我的PHP类中创建2个不同的连接,并在不同服务器的表之间连接的代码中重写我的查询.
例如,我有两个表:位于不同服务器中的用户和企业.
当它在同一台服务器上时,查询是:
select name from Enterprise E
inner join Users U on E.cod = U.cod
where E.cod = $my_code and U.codUsers in ($users);
Run Code Online (Sandbox Code Playgroud)
所以我改为:
$rst= select group_concat(U.cod) from Users as U
where U.codUsers in ($users)
select name from Enterprise E
where E.cod = $mycode and E.cod in ($rst);
Run Code Online (Sandbox Code Playgroud)
我的问题是,当我有这种类型的查询时,我怎样才能做到这一点:
select e.name, e.datebegin, e.dateend from Enterprise E
leftjoin ( select h.callQuantity, h.history from thirdtable
inner join Users u on e.cod = u.cod
where u.codHistory in (1,2,3)
group by u.cod)
Run Code Online (Sandbox Code Playgroud)
我的问题很明确?对不起我的英语不好
是否可以编写迁移来更新某个表的所有先前数据?
我正在为我的房间数据开发加密,如果我可以在迁移后加密所有行就好了