Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个这样的存储过程:
BEGIN SELECT id, name FROM t1 WHERE p1 = p2 ; SELECT image FROM t2 WHERE p3 = p4; END
我只能获取第一个结果。我怎样才能得到第二个?
您必须选择执行此操作。
第一个是做2个查询
SELECT id, name FROM t1 WHERE p1 = p2 从 t2 选择图像,其中 p1 = p2
SELECT id, name FROM t1 WHERE p1 = p2
从 t2 选择图像,其中 p1 = p2
第二种选择是重写您的查询
从 t1 加入 t2 选择 id、名称、图像 t1.id = t2.id ...