I have two tables tbl_Dropdownlis t and tbl_ListbValues
tbl_Dropdownlis t has fol. Columns.
DDLid -PK
DDLName
tbl_ListValues has fol. columns.
ListValueId
DDlid – FK
LValue
On my result set I need DDLname from tbl_Dropdownlis t & LValue associated with DDLName in tbl_ListValues.
if try a inner join query like "select tbl_Dropdownlis t.DDLName,ListV alues.LValue from tbl_Dropdownlis t inner join tbl_ListValues on tbl_Dropdownlis t.DDLid = tbl_ListValues. DDLid"
I have 14 LValue(list values) from tbl_ListValues and the same DDLName occuring 14 times for each list values like below:
DDLName LValue
OAP GHU
OAP JHU
OAP BIN
OAP DB
OAP DOD
OAP DOI
OAP CL
OAP LAB
OAP For
OAP WS 3.0
OAP WAR
OAP CLA
OAP SP
OAP SUrf
if i use a Union Query "Select LValue from ListValues
Union Select DDLName as LValue
order by LValue " My result set looks like this
BIN
CLA
CL
DB
DOD
DOI
For
GHU
JHU
LAB
OAP-From tbl_Dropdownlis t and rest from tbl_ListValues.
SP
SUrf
WS 3.0
WAR
I have to extract this to a datatable. On my datatable i want to have OAP- DDLName from tbl_Dropdownlis t as the first value then followed by the listvalues.
How can i get a result set where i have to have OAP on the top of the list followed by the list values?
Union and Inner join Query does not give me the desired result. I appreciate your help on this.
Thanks
tbl_Dropdownlis t has fol. Columns.
DDLid -PK
DDLName
tbl_ListValues has fol. columns.
ListValueId
DDlid – FK
LValue
On my result set I need DDLname from tbl_Dropdownlis t & LValue associated with DDLName in tbl_ListValues.
if try a inner join query like "select tbl_Dropdownlis t.DDLName,ListV alues.LValue from tbl_Dropdownlis t inner join tbl_ListValues on tbl_Dropdownlis t.DDLid = tbl_ListValues. DDLid"
I have 14 LValue(list values) from tbl_ListValues and the same DDLName occuring 14 times for each list values like below:
DDLName LValue
OAP GHU
OAP JHU
OAP BIN
OAP DB
OAP DOD
OAP DOI
OAP CL
OAP LAB
OAP For
OAP WS 3.0
OAP WAR
OAP CLA
OAP SP
OAP SUrf
if i use a Union Query "Select LValue from ListValues
Union Select DDLName as LValue
order by LValue " My result set looks like this
BIN
CLA
CL
DB
DOD
DOI
For
GHU
JHU
LAB
OAP-From tbl_Dropdownlis t and rest from tbl_ListValues.
SP
SUrf
WS 3.0
WAR
I have to extract this to a datatable. On my datatable i want to have OAP- DDLName from tbl_Dropdownlis t as the first value then followed by the listvalues.
How can i get a result set where i have to have OAP on the top of the list followed by the list values?
Union and Inner join Query does not give me the desired result. I appreciate your help on this.
Thanks
Comment