[Codeigniter-users] Active RecordでWHERE区にカッコを使用する場合

Back to archive index

ECS内田 uchid****@ecs*****
2009年 6月 12日 (金) 18:55:20 JST


 kunitsuji様

いつもお世話になります。内田です。

ありがとうございました。

試してみます。

>  kunitsujiです。
> 
> $this->db->where("(table.columnA in ('1','2','3')");
> $this->db->or_where("table.columnB in ('A','B','C'))");
> $this->db->where("table.columnC", "X");
> $this->db->get("table");
> 
> これでいけるかと思います。
> テストしてませんが。
> 
> >お世話になります。内田と申します。
> >
> >Active Recordにて
> >where句を以下のように生成したいのですが
> >どのように記述したらよいかご存知でしょうか?
> >
> >SELECT *
> > FROM (table) 
> >WHERE 
> > (
> >  table.columnA IN ('1','2','3')
> >  OR table.columnB IN ('A','B','C')
> >  )
> > AND table.columnC = 'X'
> >
> >WHERE区の中でカッコを使用したいのですが、
> >Active Recordを使わずに自力でSQLを組み立てるしかないのでしょうか?
> >
> >
> >よろしくお願いいたします。
> >
> >_______________________________________________
> >Codeigniter-users mailing list
> >Codei****@lists*****
> >http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users
> 
> _______________________________________________
> Codeigniter-users mailing list
> Codei****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users




Codeigniter-users メーリングリストの案内
Back to archive index