I have the above data in myTable1 and myTable2.Code:myTable1 ID1 Family_Name Family_Ace 1 Tailor 0 2 Fonda 0 3 Jackson 1 myTable2 ID2 Table1_ID First_Name elder First_Ace 1 1 Robert 1 0 2 1 Liz 0 1 3 3 Michael 1 0 4 2 Jane 0 1 5 2 Henry 0 0 6 3 Tom 0 0
And I have the below CFML code.
The CFML code will produce the following result.Code:CFML Code <cfquery datasource="DS" name="test"> select Family_Name, First_Name, Family_Ace, First_Ace from myTable1, myTable2 where ( ID1=Table1_ID and Family_Ace=1 and elder=1) or ( ID1=Table1_ID and First_Ace=1) order by ID1 </cfquery> <cfoutput query="test"> <cfif Family_Ace is 1> #Family_Name# <cfelseif First_Ace is 1> #First_Name# </cfif><br> </cfoutput>
I like to produce the result in Alphabetical order.Code:result Liz Jane Jackson
My Target result would be like the following.
Thanks in AdvanceCode:Target Result Jackson Jane Liz








Bookmarks