SQL语句里我想同时查找p_list y_list f_list里所有p_j=1的所有内容然后根据p_x的值排序

来源:百度知道 编辑:UC知道 时间:2024/06/04 18:49:33
SELECT top 7 * FROM p_list Union all select id,f_name,f_user,f_sex,id,f_qq,p_j,p_j,f_hot,f_url,f_url,f_date from y_list; Union all select id,f_name,f_user,f_sex,id,f_qq,p_j,p_j,f_hot,f_url,f_url,f_date from f_list where p_j=1 order by p_x desc
这是我写的但是有错误不对不知道因该如何修改
三个表里都有p_x
我想依据p_x的值排列
我的QQ:121361574

三个表依据什么条件连接?
指定连接条件和连接方式后,还要指定别名, where 和order by 用的字段前面也要加别名

select * from p_list,y_list,f_list where p_j=1 order by p_x desc

a