mysql存储过程问题(急...) 现在我有两张表,例如:一张A表(int a,int b,date c) 另一张B表(int a,int b,int d,int e),现在我想插入A表(int a,int b,date c)的值是B表中查询出来的(int a,int b,当前时间),想写一个存储过程!insert A(a,b,c) select a,b from B;但是data不知道插入!希望大家能给我写一个存储过程!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 # mysql> select current_timestamp(); # +---------------------+ # | current_timestamp() | # +---------------------+ # | 2010-01-18 21:24:37 | # +---------------------+ # 1 row in set (0.00 sec) # # mysql> select current_date(); # +----------------+ # | current_date() | # +----------------+ # | 2010-01-18 | # +----------------+ # 1 row in set (0.00 sec) # # mysql> select current_time(); # +----------------+ # | current_time() | # +----------------+ # | 21:24:46 | # +----------------+ # 1 row in set (0.00 sec)mysql常见的时间函数就上面3个,你可以选择一个合适的。 insert A(a,b,c) select a,b,current_timestamp() from B date c 只是其中一个字段,还有其它很多字段是B表中没有的!我也想将其它字段插入进去!在线等……求大神帮下忙!我看了用游标,但是速度有点慢…… insert A(a,b,c,new1,new2,new3) select a,b,current_timestamp(),其它字段1,其它字段2,其它字段3 from B要插入的其他字段同理,如果是固定值,直接写即可 这里是sql server版,mysql<>sql server 求一個函數 关于数据打横显示的问题 ···数据库差异备份的Transact-SQL SQL实现???在线等,解决了马上给分 请教一个事务回滚的问题? 如何用sql批量进行这些工作?! 怎样用sql查询出一个数据表的字段名称?? SQL server 关于安全性问题的应用例子~~ 这个触发器怎么写? 怎么样来写这个SQL语句? 关于日期判断。。。 更新表的时候怎么带条件 语句select ntid from tb_newstype where ntpid={0}中ntpid={0}中括号有什么作用
# mysql> select current_timestamp();
# +---------------------+
# | current_timestamp() |
# +---------------------+
# | 2010-01-18 21:24:37 |
# +---------------------+
# 1 row in set (0.00 sec)
#
# mysql> select current_date();
# +----------------+
# | current_date() |
# +----------------+
# | 2010-01-18 |
# +----------------+
# 1 row in set (0.00 sec)
#
# mysql> select current_time();
# +----------------+
# | current_time() |
# +----------------+
# | 21:24:46 |
# +----------------+
# 1 row in set (0.00 sec)mysql常见的时间函数就上面3个,你可以选择一个合适的。