Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Jamie Belanger <jamie_belanger at globalcrossing dot com>
Subject: RE: avoiding the cross-product
Date: Feb 22 2000 2:03PM

What about running a select distinct rather than just a regular select? Not
sure how you're doing it.

Jamie Belanger
Sys Admin, Global Crossing
(319) 298-1489 or ext. 489 

-----Original Message-----
From: []
Sent: Tuesday, February 22, 2000 1:03 AM
To: SybPerl Discussion List
Subject: avoiding the cross-product

This is more of a basic sql question (I'm pretty new to sql). I need
to do a 'dump' of a Sybase database for initializing an LDAP database.
A person record in the Sybase database spans a number of tables, where
some of the info is singly-occurring, and other is multiply occurring
(e.g. the appointment table can have n rows for the same employee, and
the 'general attribute' table can have m rows for that person.) If I do
a massive join to get all that info, I get n*m rows for that person in
the result set.

Now since this dump might only happen once, a certain amount of
inefficiency can be tolerated. But not n*m rows per person. So what is
the right way to do this? Do I just get the singly occurring stuff in
one query, and then get each of the multiply-occurring stuff in
separate queries each? Or is there a different technique that accomplishes

Michael A. Grady                  
Senior Research Programmer         
University of Illinois                      (217) 244-1253  phone
Computing & Communications Services Office  (217) 244-7089  fax
Rm. 1514 DCL, 1304 W. Springfield Ave       Urbana, IL 61801