我试图在SQL的电话名称列表中随机分配名称。例如,
Date |Customer Number| Consultant Name
2/24/18 |193-245-6445 | Jill
2/15/18 |123-456-4663 | Amy
答案 0 :(得分:0)
同意The Impaler,您需要提供更多信息。假设它是Oracle,并且您有两个表需要联接。您可能会假设
select table1.Date, table1.Customer_Number, table2.Consultant_Name
from <Table 1> table1
left join (select rownum as rownumout, tb2.*
from <Table 2> tb2) table2
on 1 = 1
where table2.rownumout = floor(dbms_random.value(1, 100));
假设您在表2中有100个名称。