|  | Posted by --CELKO-- on 06/27/07 00:27 
I hope you know better than to use GUIDs in an RDBMS except forreplication, never to use reserved words like "date" for data element
 names or vague names like "type" -- the basic ISO-11179 rules, etc.
 You also seem to confuse fields and columns, but let's skip the signs
 of poor SQL practices for now.
 
 If you rewrite this in statement  into Standard SQL, you will see if
 the join returns multiple rows instead of a scalar value.  That would
 let us know that the schema has serious design problems.  The illegal
 syntax you used can do multiple updates on each row; talk to an old
 Sybase programmer about this problem.
 
 UPDATE A  SET field1
 = (SELECT  C.field1                  FROM B, C
 WHERE A.guid1 = B.guid1
 AND B.guid2 = C.guid2             AND C.somekind_type = 1
 AND @my_date BETWEEN B.start_date AND B.end_date);
  Navigation: [Reply to this message] |