Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

blopf

@blopf
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SELECT in UPDATE statement
    B blopf

    What I mean is that if I do the select with an select into statement it will create a new table for me with the result. I dont have an update statement, because all the ones I tried generates errors :(

    Database database help question announcement

  • SELECT in UPDATE statement
    B blopf

    Hello All, I have a problem that I cannot seem to solve. My guess is that I am thinking wrong. The problem is probably really simple but I cannot seem to solve it. I have two tables, one called test_user and one called test_answer. (Below all types in the tables are integers) test_user looks like this: user_id,time_answered,+some other statistics 1 0 2 0 3 0 test_answer looks like this: test_id,user_id,answered 0 1 1 0 2 1 0 3 0 1 1 1 1 2 1 1 3 0 3 1 1 3 2 0 3 3 0 Basicly test_answered contains a 1 in the answered if the user has answered a question on test test_id. What I want to do is sum up all the answers and update the test_user table. If I do this SQL-query then I get the table I want to update test_user with. select user_id,sum(answered) as sum from test_answer where answered = 1 group by user_id (The output will be: user_id,sum 1 3 2 2 ) Is there a simple way to update the test_user tables without doing a select into (and destroying all other data I have in the table.) As I told you this is probably an super simple question but I cannot get it right? hope you guys can help me!

    Database database help question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups