2
我有麻烦了以下任务完成:SQL选择两个用户ID为不同的别名
我有2个表:
User:
-uid
-username
challenge:
-cID
-challengerID
-challengedID
现在我想从c#
应用与运行insert into
(!每例如挑战user1
user2
)
现在SQL
是:
insert into challenge (challengerID, challengedID)
where challengerID = id of user1 and challengedID = id of user2.
如何抓住这两个user IDs
并将它们存储在挑战表的不同字段中?
您正在使用哪个[DBMS](https://en.wikipedia.org/wiki/Database)? Postgres的?甲骨文? DB2?火鸟? –
你怎么知道用户选择什么?如果你已经知道这些ID,为什么你不能直接添加它们?或者你有其他的机制来找到合适的用户? –
事情是它的一个机器人。用户可以更容易地使用提及功能,而不是记住ID或首先将其读出。所以我必须这样做。 – trices