user6592730 user6592730 - 5 months ago 24
SQL Question

How to retrieve multiple data in a column of a table using a query?

I have 2 tables named as master and kpi.

Master table has following columns

no, name, dtStart, dtEnd, status, user and dtCreate

kpi table has following columns

no and kpName

"no" in kpi table refers "no" in master table

What i expect to do is, when I select a name from the dropdownlist relevant details in both tables should be displayed.

One name has unique "no". Also "no" can have multiple kpNames.

Please help me.


try this:

SELECT a.[no],, a.dtStart, a.dtEnd, a.[status], a.[user] , a.dtCreate 
From masterTable  a 
Inner JOIN kpiTable b ON a.[no] = b.[no]
Where b.Name = 'dropDownSelectedValueName'