I need to select distinct records in three columns of my table to populate 3 select boxes on my asp page.
I have these records
Country Account Forecast
China A1111 Budget
China A1111 Actual
China A2222 Actual
China A3333 Budget
Japan A2222 Actual
Japan A3333 Actual
Japan A4444 Budget
Japan A5555 Budget
Singapore A3333 Budget
Singapore A6666 Actual
For my first select box - Country, I would only like to have:
China
Japan
Singapore
For my 2nd select box - Account
A1111
A2222
A3333
A4444
A5555
A6666
For my 3rd select box - Forecast
Actual
Budget
Is there a way to select the distint records with only one select statement?
I have this:
"select country, account, forecast from table1 group by country, account, forecast"
and it only "grouped" the country.
Anjy help will be greatly appreciated.
I have these records
Country Account Forecast
China A1111 Budget
China A1111 Actual
China A2222 Actual
China A3333 Budget
Japan A2222 Actual
Japan A3333 Actual
Japan A4444 Budget
Japan A5555 Budget
Singapore A3333 Budget
Singapore A6666 Actual
For my first select box - Country, I would only like to have:
China
Japan
Singapore
For my 2nd select box - Account
A1111
A2222
A3333
A4444
A5555
A6666
For my 3rd select box - Forecast
Actual
Budget
Is there a way to select the distint records with only one select statement?
I have this:
"select country, account, forecast from table1 group by country, account, forecast"
and it only "grouped" the country.
Anjy help will be greatly appreciated.