Page is a not externally linkable
- Code, Content, and Presentation
-- Perl Server Side CGI Scripting
---- Writing an Efficient Query


ukgimp - 12:10 pm on May 29, 2003 (gmt 0)


Will two queries first one builds up the list of values that are not active.

$sql1 = "get records that are not active (whichever way round)"

The use the values to build the IN parameter for the second query ($IN)

Sql2 = "SELECT * FROM tbl WHERE colum IN ($IN)"

I managed to get this type of query going for a subject table so that only bottom level subjects appeared and it seemed to do the job well.

Cheers


Thread source:: http://www.webmasterworld.com/perl/2910.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com