SELECT id FROM table1 WHERE name LIKE 'test%';
That would show me all the ids in table1 with the id of anything that matched test%. So I have been doing this the long way doing this :
SELECT * FROM table2 WHERE id = '1011';
Is there anyway to make my table1 query jump and auto insert to WHERE id = '1011', I'd like it to auto match it up whats in query one to query two. Instead of having to run the second query over and over again and get all the results faster.
You want to do a JOIN:
SELECT a.*
FROM table2 a
JOIN table1 b
ON a.id = b.id
WHERE b.name LIKE 'test%'
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다