0

我想在 dataTables 上执行 NOT IN 操作或子查询,但我能够配置如何实际执行此类操作。甚至可以执行这样的操作吗?

这是我的查询:

->select("t_geocode.form_no,t_store.name ,CONCAT(t_store.address,'',t_location.address) AS locaddress,t_admin.username,t_geocode.creation_date,t_geocode.notes IS NOT NULL,t_geocode.latitude,t_geocode.longitude", FALSE)
                ->from("t_geocode")
                ->join("t_store", "t_store.form_no = t_geocode.form_no")
                ->join("t_location", "t_location.id = t_store.area")
                ->join("t_admin", "t_admin.user_id = t_geocode.created_by")
                ->where("t_geocode.is_discarded", 0)
                ->where("t_geocode.is_pending", 1)
                ->where_not_in("t_geocode.form_no","t_store.form_no")
                ->add_column("username", $usernameBar, 't_admin.username,t_geocode.creation_date,t_geocode.notes IS NOT NULL')
                ->add_column("coordinates", $cordinateBar, 't_geocode.latitude,t_geocode.longitude')
                ->add_column("actions", $actionLinkBar, 't_geocode.form_no')
                ->unset_column("t_store.name")
                ->unset_column("t_store.address")
                ->unset_column("t_location.address")
                ->unset_column("locaddress")
                ->unset_column("t_admin.username")
                ->unset_column("t_geocode.creation_date")
                ->unset_column("t_geocode.notes IS NOT NULL")
                ->unset_column("t_geocode.latitude")
                ->unset_column("t_geocode.longitude");

我需要对 t_geocode 和 t_store 表 form_no 字段执行 NOT IN 操作。有人可以帮忙吗?

4

1 回答 1

1

一个可能适合您情况的解决方法是创建 MYSQL VIEW,其中包含您需要显示的所有条件并直接从视图中选择,因为我可以看到您未设置很多列,

希望有帮助

于 2013-06-15T10:09:52.153 回答