gpt4 book ai didi

MySQL在选择时获得唯一键

转载 作者:可可西里 更新时间:2023-11-01 08:54:45 26 4
gpt4 key购买 nike

我正在做这个选择:

select code,name from talbe1
union all
select code,name from table2

实际的代码对我来说并不重要,但对我来说重要的是代码列将是唯一的列,并且对于这个选择我不能授予它..有没有任何保存词/东西可以给我类似的东西:

select getUniqueCode(),name from(
select name from talbe1
union all
select name from table2)

谢谢。

最佳答案

看看 mysql UUID call .这会导致这样的结果:

select UUID(),name from(
select name from talbe1
union all
select name from table2)

关于MySQL在选择时获得唯一键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6955726/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com