Ticket #670 (closed Feature Request: duplicate)

Opened 5 months ago

Last modified 5 months ago

subqueries with db builder

Reported by: Nodren Owned by: zombor
Priority: minor Milestone: 2.2
Component: Libraries:Database Version: SVN HEAD
Keywords: Cc:

Description

i think the db builder is great, and especially with the rewrite it can be a whole lot better.

i'm thinking the value of a in, where, etc functions can be a db builder query itself... to allow for sub queries

an example, expressing this query:

select * from table 1
where id in (
  select table1_id 
  from table2 
  where something = 'yes'
)

would be expressed

$db->from('table1')->in($db->select('table1_id')->from('table2')->where(array('something'=>'yes')))

just an idea.

Change History

Changed 5 months ago by Shadowhand

  • status changed from new to closed
  • resolution set to duplicate

This will be part of #204.

Note: See TracTickets for help on using tickets.