Merge 2 tables for a SELECT query?

前端 未结 3 1747
独厮守ぢ
独厮守ぢ 2021-01-03 07:42

First.. here are the two tables I\'ve created (sans irrelevant columns)..

CREATE TABLE users_history1 (
  circuit tinyint(1) unsigned NOT NULL default \'0\',         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-03 08:19

    If you want to merge to table and you want to select particular column from one table and in another table want to select all.

    e.g.

    Table name = test1 , test2
    

    query:

    SELECT test1.column1,test1.column2, test2.* FROM test1 ,test2
    

    if you want to merge with particular column

    query:

    SELECT test1.column1,test1.column2, test2.* FROM test1 ,test2 where test2.column3='(what ever condition u want to pass)'
    

提交回复
热议问题