Peter Donald <[EMAIL PROTECTED]> wrote:

[re: foreach being evil and SQL's select being good]

select has zero ordering semantics

Foreach also has zero ordering semantics. In fact, saying 'SELECT * FROM MyTable' is equivalent to 'foreach (*) in MyDirectory'. (In reality both select and foreach impose default ordering on the result set but that still doesn't produce a valid argument against either).


As for nesting selects, you can nest foreach too:

SELECT * FROM MyTable WHERE (SELECT ...) is roughly equivalent to

foreach $file in MyDirectory
 foreach $extension in $file
   print $file.$extension

Alex Smith
Insight LLC
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com



Reply via email to