Gossamer Forum
Quote Reply
SELECT DISTINCT
I have a problem with this:

Code:

my $cat_db = $DB->table ('Links','CatLinks','Category');
$cat_db->select_options ("ORDER BY ID ", "LIMIT 8");
my $sth = $cat_db->select (['Links.ID','Contact_Name','Logo','Ort','Name2'],
GT::SQL::Condition->new ('Logo','!=','',
'isValidated','=','Yes',
'visible','=','Yes'
) );


Because most of the links are in more than one category, i got no unique links with the query above.
The query now is: SELECT * FROM Links, CatLinks, Category WHERE ... but i need something like:
SELECT DISTINCT FROM Links, CatLinks, Category WHERE ...

Shurely i can use a query without a LIMIT and compare the IDs stoppting with a while counter=8;
but it should be with one query, i hope. Some ideas?
Subject Author Views Date
Thread SELECT DISTINCT Robert 2324 Jun 5, 2005, 2:53 PM
Thread Re: [Robert] SELECT DISTINCT
Robert 2218 Jun 5, 2005, 3:11 PM
Post Re: [Robert] SELECT DISTINCT
pugdog 2149 Jun 6, 2005, 5:29 PM