using INSERT and SELECT DISTINCT
Posted: Sat Jun 17, 2006 1:10 pm
hy guys
if we want to INSERT into a table 3 values, and 1 of them at this query need to be always 1, and the SELECT DISTINCT we gona use just get 2 values, and the third one need to be 1 how can i do this ???
this is the query:
but, the value for lider, dont come from the SELECT DISTINCT need to be 1 in this query but i cant figure how to insert it 
if we want to INSERT into a table 3 values, and 1 of them at this query need to be always 1, and the SELECT DISTINCT we gona use just get 2 values, and the third one need to be 1 how can i do this ???
this is the query:
Code: Select all
mysql> insert into cidpid (pid,cid,lider) select distinct members.pid,clans.cid
from members,clans where clans.pid_criador='3nrq74z';