Use each id in table a to query the information of this id in people table.The statement is as follows:
$this->db->from ("a"); $this->db->join ("b", "sites.id=b.id");
Use each id in table a to query the information of this id in table b.
Note the SQL convention, if a column name is duplicated in two tables,You need to put the table name and a "." Before the column name. So sites.id in the location table means that the table where id is is sites. When performing SQL multi-table query,It ’s best to uniquely identify the column names,This will avoid ambiguity,You can also make yourself clear.
Example:You execute the following statement
$this->db->select ("*"); $this->db->from ("blogs"); $this->db->join ("comments", "comments.id=blogs.id"); $query=$this->db->get ();
Is equivalent to executing this sql statement
select * from blogs join comments on comments.id=blogs.id
If i want to use multiple joins in your query,This function can be called multiple times.
If you need to specify the type of join, you can specify it through the third parameter of this function.The options are:left, right, outer, inner, left outer, and right outer.
$this->db->join ("comments", "comments.id=blogs.id", "left"); //Generate:left join comments on comments.id=blogs.id
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- xcode - pod install [!] no `podfile 'found in the project directory
- dart - flutter: the instance member'stars' can't be accessed in an initializer error