Jan
13
comment SQL Server : how to loop through a table applying multi-record updates to another?
I seem to have sussed it now - thanks!
Jan
12
comment SQL Server : how to loop through a table applying multi-record updates to another?
The materials table has a internal, numeric primary key field - is this good enough? (I left it off previously in trying to simplify the problem.)
Jan
12
revised SQL Server : how to loop through a table applying multi-record updates to another?
zeroed out dummy initial data values to avoid confusion; mentioned internal primary key
Jan
12
comment SQL Server : how to loop through a table applying multi-record updates to another?
@Damien_The_Unbeliever The initial data values I had are just dummy values. I'll zero them to avoid confusion. I think that those records that haven't been updated yet should be all the same except for the type_id, and so it doesn't matter which individual records are updated.
Jan
12
comment SQL Server : how to loop through a table applying multi-record updates to another?
@Donal The first record of material_updates means "update 3 materials with type_id 1 to data 42". Likewise with the other two.
Jan
12
comment SQL Server : how to loop through a table applying multi-record updates to another?
@PanagiotisKanavos I don't follow you - how do the solutions given there enable me to control the number of matching records to update?
Jan
12
revised SQL Server : how to loop through a table applying multi-record updates to another?
added 837 characters in body
Jan
12
comment SQL Server : how to loop through a table applying multi-record updates to another?
@PanagiotisKanavos On a quick look, that other question seems to me to be a case where there's a one-to-one correspondence between records of the updates table and records of the table to be updated, which isn't the case here.
Jan
12
comment SQL Server : how to loop through a table applying multi-record updates to another?
@ZoffDino Do you mean examples of a material_updates table and what the materials table should look like before and after the operation?
Jan
12
asked SQL Server : how to loop through a table applying multi-record updates to another?
Dec
20
comment Is the class of cardinals totally ordered?
@ThomasAndrews By "there are cardinals which cannot be well-ordered" do you mean that exist cardinalities s.t. sets of this cardinality can't be well-ordered, or that there exist cardinalities that are not ordered relative to each other?
Dec
19
awarded Excavator
Dec
19
revised Need a formula for cumulative moving averages in Open Office
clarify which type of "moving average" is being talked about - I had expected the simple moving average
Dec
16
comment Possible to use SQL to sort by date but put null dates at the back of the results set?
Yes, NULLS FIRST is an example of something that makes this simple task simple, but sadly not all DBMSs support it. Another example of a simple task that some DBMSs make really difficult is dropping a table only if it exists. ehow.com/how_4738206_database-table-only-already-exists.html
Dec
16
comment Possible to use SQL to sort by date but put null dates at the back of the results set?
In MSSQL, ISNULL returns its first argument, or its second argument if its first argument is null. There's a standard SQL function COALESCE which does the same and also accepts more than two arguments. But this is a bit off-topic since the poster is asking about MySQL....
Nov
23
awarded Popular Question
Oct
19
awarded Famous Question
Oct
14
awarded Excavator
Oct
14
awarded Editor
Oct
14
revised MVC and individual elements of the model under a common base class
updated link
1 2 3 4 5