Help-a-Newb with query ...

select distinct
threads.id,
threads.name,
threads.readonly,
threads.active,
threads.forumidfk,
threads.useridfk,
threads.author,
threads.datecreated,
forums.name as forum,
threads.author as username,
threads.sticky,
threads.views,
conferences.name as conference,
conferences.id as conferenceid,
threads.lastpost,
threads.msgcount as messagecount

from
(threads inner join forums on threads.forumidfk = forums.id)
inner join conferences on forums.conferenceidfk = conferences.id

where 1=1

and threads.active = 1

<cfif isDefined(“arguments.forumid”)>
and threads.forumidfk =

======================================

… as it is now it works fine but I need to add the following condition :

<cfif isDefined(“arguments.testOnly”) and arguments.testOnly IS 1>
and users.testOnly =

please help with the [select] and [from] (inner join?). Thank you very much.

=====================================

order by threads.sticky desc, threads.lastpost desc