Reply to Re: Stumped by SQL challenge

Your name:

Reply:


Posted by imani_technology_spam@yahoo.com on 09/20/05 19:10

Thank you for the information. I'm wondering how this would work as a
SELECT statement. Also, let's assume there is a foreign key constraint
on fk_parent_id. And the pk field is a primary key.

David Portas wrote:
> Thanks for posting the DDL. It does help if you include keys and constraints
> with your CREATE TABLE statements and post some sample data abd required
> results too. Here's my guess, hopefully it will give you a start even if it
> isn't exactly what's required.
>
> UPDATE child
> SET newcode = 10
> WHERE code = 5
> AND EXISTS
> (SELECT *
> FROM child AS C
> WHERE fk_parent_id = child.fk_parent_id
> AND code > child.code
> AND dt < child.dt) ;
>
> --
> David Portas
> SQL Server MVP
> --

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация