求sql语句
我有一张表 用的联合主键 字段分别是 uid edition_uid
我现在要根据 edition_uid的2个值如 ‘xxx’,‘yyy’
实现一个全连接的效果即
xx yy
1 1
2 null
null 3
这样的效果 语句如何写
附上我写的错误语句
SQL code:
SELECT
fi1.content ccc,
fi2.content yyy
from
format_item fi1
[color=#FF0000]Full JOIN //不支持?[/color]
format_item fi2
ON
fi1.uid = fi2.uid
WHERE
fi1.edition_uid='xxx'
AND
fi2.edition_uid='yyy'
ORDER BY
fi1.create_time,fi2.create_time
mysql?
用LEFT JOIN+RIGHT JOIN来解决
mysql 5.1
对这个不大熟 能帮忙写下语句或者伪代码也可以 谢谢
大概是这样,你测试一下
好谢谢 我试试
现在的问题好像是连接条件那有点问题
是不是把where 后面的条件连同连接条件作为一个
现在这种情况查出来只是xxx 和yyy 中uid相同的
也就是效果只有
xx yy
1 1
这种
贴记录及要求结果出来看看
HTML code
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
protected void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......
我是在toad中输入下段sql
declare
TYPE test_rec IS record(
code varchar(10),
name varchar(30)
);
v_book test_rec;
......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......