JOIN
语句进行关联查询。为了只关联一条数据库记录,可以使用子查询或限制条件,,,``sql,SELECT a.*, b.column_name,FROM table1 a,LEFT JOIN (, SELECT column_name, MIN(id) as min_id, FROM table2, GROUP BY column_name,) b ON a.id = b.min_id;,
``,,这样可以实现只关联一条数据库记录的效果。JOIN
语句进行关联查询。为了只关联一条数据库记录,可以使用子查询或限制条件,,,``sql,SELECT a.*, b.column_name,FROM table1 a,LEFT JOIN (, SELECT column_name, MIN(id) as min_id, FROM table2, GROUP BY column_name,) b ON a.id = b.min_id;,
``,,这样可以实现只关联一条数据库记录的效果。Powered By Z-BlogPHP 1.7.3