- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我必须在两个不同的表中运行两个插入语句。sql如下:
INSERT INTO Table1 ('t1_name', 't1_class') VALUES ('Joe','8');
Table1 有一个自动增量的 ti_id 列
INSERT INTO Table2 ('t2_ti_id','t2_course') VALUES(< 'ti_id' from Table1 call >,
'English'),(< 'ti_id' from Table1 call >, 'Math').
所以最终的结果应该是,table2 查询中使用了为 table1 查询设置的自动增量 id
Table1
t1_id ti_name t1_class
1 Joe 8
Table2
t2_id t2_t1_id t1_course
1 1 English
2 1 Math
t1_id 和 t2_t1_id 有一个外键设置
请告诉我如何从同一个 sql 进行调用,这样我就不必为此制作一个单独的 perl 脚本
提前致谢
最佳答案
试试这个:
INSERT INTO Table1 (t1_name, t1_class) VALUES ('Joe','8');
SET @t1id = SELECT LAST_INSERT_ID();
INSERT INTO Table2 (t2_ti_id, t2_course)
VALUES (@t1id,'English')
关于mysql - Insert based on Another Insert with mysql 插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23139259/
我想做的是从 abcd 方法获取返回值,并使用该值作为 fname 的替换,并且错误继续发生。 如何修复这个错误? ICB164000395.txt 有四行。我想要 line_count 打印出 4(
我正在尝试在我的“主页”tabPanel 上放置一个指向我应用程序的所有其他 tabPanel 的链接。 思路如下: ui = navbarPage("", tabPanel("ho
posts.component.ts - 这是在 AppComponent 的路由器 socket 中加载的 PostsComponent { posts: any = [
struct dataStruct { const char* s; int num; }; struct Final_struct { int n; dataStru
这是我要实现的目标: 这是我写的 HTML 代码:
我有一个主表格。我有一个名为Text123的文本字段。当用户单击文本123时,它会打开另一个表单。在这个新表单中有两个控件。一个是名为cmb1的组合框,另一个是名为ext456的文本字段。当用户从组合
我有:。Html:。这是css:。我将根据当前视图处于网格模式还是旋转木马模式,在高度发生变化时动态设置--About-Content-Height,具体如下:。我的问题在于:。和。Console.l
当 SM 上正在运行的 warp 停滞时,必须在 SM 上安排另一个 warp 来交换停滞的 warp 以弥补延迟。但是替代品是否与停滞的扭曲来自同一个 block ,或者它必须属于另一个 block
我的第一个数据帧 df 包含 start_date 和值,第二个数据帧 df_v 仅包含日期。 我的df: +-------------------+-----+ | start_date
考虑我在 master我有远程分支 develop在我名为 origin 的 Remote 上,一切都是最新的,我已经跑了git fetch . 现在git merge origin/develop之
考虑下表: un_id avl_id avl_date avl_status 1738 6377398 2011-03-10 unavailable 1738 6377399
首先,我必须说我是 MVC4 的新手,并且同时学习和开发这个应用程序。在此应用程序中有“index.cshtml” View ,它包含“fresh”span(按钮)。 单击此按钮后,我想要: 重定向到
我有一个名为 template.xlsx 的 template excel 文件,其中包含许多工作表。我想将数据从单独的 .csv 文件复制到 template.xlsx 的第一张表中(命名为 dat
所以我使用的是Django 4.2,它通过Django-JET-REBOOT Fork与Django-JET管理包一起使用;它通过良好的功能和用户体验增强了管理。。每次我将我的应用程序部署到生产环境中
为什么我们更喜欢使用192.168.1.0/24来获得更多的网络?--网络#1 192.168.1.0/25#2 192.168.1.128/25。为什么不让192.168.2.0/24再建一个网络,
我有一个 3000 万条记录的 mysql 表。 有大约 20 列,我将使用其中的 15 列插入到另一个表中。 现在我无法使用 PHP 加载这个大型数据集(选择 3000 万行并加载到内存中是不可行的
我正在尝试在上一个动画发生后对一系列 div 进行动画处理。我试图将 .mouseenter 和 .mouseleave 调用到动画为不透明度的相同 div: 1. 第一个动画似乎取代了之后更改不透明
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我的表中有 3 列用户名、密码和元素。 element的值是1。所以我创建了一个网页如果用户插入正确的用户名和密码,我希望我的PHP检查如果element = 1然后做我想做的事情并将element更
是否可以像示例中那样也定位另一个元素? click some content some content 有点像... #AAA:target #BBB{color:red} 最佳答案 在这种情况下,您
我是一名优秀的程序员,十分优秀!