Ask a Question related to Coldfusion Database Access, Design and Development.
-
HeloWorld #1
Sub-queries assistance, please/
Hi Everyone,
For simplyfying things, let's assume that I have two tables MAIN and USERS
USERS contains the fileds ID, FIRSTNAME, LASTNAME
MAIN contains AUTHOR, EDITEDBY, APPROVEDBY
My question is, how do I retrieve the three instances of FIRSTNAME and
LASTNAME?
I assume I need to use sub-queries, but have never successfully used them
before...
HeloWorld Guest
-
Need Assistance PLEASE
I accidently changed my adminstative rights to limited. How do I correct this or access the administrator icon... It claims my administrator has a... -
I could use some assistance...
I am having some issues with CF7 - I am sure it's just me being a newbie to Cold Fusion... But here is the deal... I need to set up several WSDLs to... -
Need some assistance please
I will try to word this as best I can. Some info on our site first: We have tried to make our sites structure reflect our organizational... -
Queries Of Queries Single Quote Problem
When using queries of queries I'm having the following issue. Select Company_ID From qry_MyQuery Where Company_NM = 'MyString''s' <----... -
YOUR ASSISTANCE IN THESE MATTER.
GULF BANK PLC, GULF BANK HOUSE, Plot 107 Ahmadu Bello Way V/Island Lagos. Nigeria. EMAIL:gulfbank_plc@yahoo.co.uk I am Mr. SIMON OTEDOLA,... -
Dan Bracuk #2
Re: Sub-queries assistance, please/
Your question is very vague. Here is a specific question. Firstname and Lastname of what?
Dan Bracuk Guest
-
HeloWorld #3
Re: Sub-queries assistance, please/
Hi Dan,
What I am trying to do is return the first name and last name of three
separate people.
How do I return multilple values of FIRSTNAME / LASTNAME?
One that corresponds to MAIN.AUTHOR and MAIN.EDITEDBY and MAIN.APPROVEDBY?
Eg. MAIN.AUTHOR = '1', MAIN.EDITEDBY = '2' etc.
USERS table contains ID, FIRSTNAME, LASTNAME
1, fred, nurk
2, john, smith
I need a result set that allows john smith and fred nurk to appear on the same
row.
I was originally thinking of using a subquery... but perhaps I need to use
Tables aliases? i really don't know - thus my asking :)
HeloWorld Guest
-
MikerRoo #4
Re: Sub-queries assistance, please/
Something like this will work on most databases. Different DB's allow more
efficient methods:
(I won't cover the left join case in this thread.)
<b>
SELECT
tAuth.FirstName AS AuthNameFirst
, tAuth.LastName AS AuthNameLast
, tEdit.FirstName AS EditNameFirst
, tEdit.LastName AS EditNameLast
, tApprv.FirstName AS ApprvNameFirst
, tApprv.LastName AS ApprvNameLast
, tMain.AUTHOR <!--- Add any main column like this. --->
FROM
MAIN tMain
, USERS tAuth
, USERS tEdit
, USERS tApprv
WHERE
tMain.AUTHOR = tAuth.ID
AND
tMain.EDITEDBY = tEdit.ID
AND
tMain.APPROVEDBY = tApprv.ID
</b>
MikerRoo Guest
-
Dan Bracuk #5
Re: Sub-queries assistance, please/
Given this:
USERS table contains ID, FIRSTNAME, LASTNAME
1, fred, nurk
2, john, smith
How do I know who is an author, editor, etc?
Dan Bracuk Guest



Reply With Quote

