我有一个像这样的sql语句:
Select Id,Name From table where id = var
Select Id,Name From table where id = var
Select Id,Name From table where id = var
我能够在一个查询中进行多项选择,但每次选择只允许一列。
SELECT (
SELECT COUNT(*)
FROM user_table
) AS tot_user,
(
SELECT COUNT(*)
FROM cat_table
) AS tot_cat,
(
SELECT COUNT(*)
FROM course_table
) AS tot_course
答案 0 :(得分:2)
答案 1 :(得分:2)
答案 2 :(得分:0)
SQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables.
例如:
SELECT user_table.name, user_table.email, cat_table.title
FROM user_table
FULL JOIN cat_table
ON user_table.cat_id=cat_table.id
ORDER BY user_table.id