使用Eloquent ORM选择Laravel中的子查询

时间:2016-11-06 07:18:04

标签: laravel laravel-5

我想用laravel eloquent ORM执行以下原始查询: cppFunction(' NumericVector fun() { double data[5] = {1.0,2.0,1.0,2.0,1.0}; return as<NumericVector>(wrap(std::vector<double>(data,data+sizeof(data)/sizeof(*data)))); } '); fun(); ## [1] 1 2 1 2 1

关于laravel雄辩的ORM。我试过了:

SELECT *,(SELECT country FROM tbl_sim_numbers WHERE highland_id= b.highland_id) as country1,(SELECT operator FROM tbl_sim_numbers WHERE highland_id= b.highland_id) AS operator1 FROM tbl_sim_distributions b ORDER BY b.created_at

但是上面的代码给出了错误。有人,请帮忙。

0 个答案:

没有答案