Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 How to get unique value from DB

Author  Topic 

Arunavally
Yak Posting Veteran

58 Posts

Posted - 2013-10-19 : 06:53:10
Hai,
I have maintained batch table

This field have

Stu_Id(Primary Key) BatchId (Not Primary key)
STU0001 APR042013
STU0002 APR062013
STU0003 APR042013


In form_load i want to load batch id frm DB to Combo Box. But i want to only one set of Id allow in combo box. That means..

In 1st row BatchId is APR042013
In 3rd row BatchId is APR042013 (Same)

But i want to display one Id (APR042013)instead of these two. and also 2nd row Id.

Kindly help me sir.

Thanks in advance
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-10-19 : 12:23:09
SELECT DISTINCT BatchID FROM dbo.Table1



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

Arunavally
Yak Posting Veteran

58 Posts

Posted - 2013-10-21 : 00:55:55
Thank you.
quote:
Originally posted by SwePeso

SELECT DISTINCT BatchID FROM dbo.Table1



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA

Go to Top of Page
   

- Advertisement -