•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 455,973 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,828 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 923 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
hi am raj!
am a asp , sql server 2000 programmer
i need a sql query to select unique rows based on noofcards,versionno,id here am giving the database
-------------------------------------------
id email ccno vno nc
-------------------------------------------
41 b@r.com f 2465 1 1
41 b@r.com f 9898 1 3
41 b@r.com a 9898 1 2
41 b@r.com f 2465 2 1
41 b@r.com e 6226 2 2
41 b@r.com s 2465 3 1
------------------------------------------
ccno = creditcardno
vno = versionno
no = noofcard
the o/p i should get is
-------------------------------------------
id email ccno vno nc
-------------------------------------------
41 b@r.com f 3554 1 3
41 b@r.com e 6226 2 2
41 b@r.com s 2465 3 1
------------------------------------------
i tryed this query
select * from creditcardinfo where versionno =(select max(versionno) from creditcardinfo where id =41)
but am getting only one row with the maxversionno
41 b@r.com s 2465 3 1
so, pleas help me in getting the row i 've specified above.
any help will be appreciated.
am a asp , sql server 2000 programmer
i need a sql query to select unique rows based on noofcards,versionno,id here am giving the database
-------------------------------------------
id email ccno vno nc
-------------------------------------------
41 b@r.com f 2465 1 1
41 b@r.com f 9898 1 3
41 b@r.com a 9898 1 2
41 b@r.com f 2465 2 1
41 b@r.com e 6226 2 2
41 b@r.com s 2465 3 1
------------------------------------------
ccno = creditcardno
vno = versionno
no = noofcard
the o/p i should get is
-------------------------------------------
id email ccno vno nc
-------------------------------------------
41 b@r.com f 3554 1 3
41 b@r.com e 6226 2 2
41 b@r.com s 2465 3 1
------------------------------------------
i tryed this query
select * from creditcardinfo where versionno =(select max(versionno) from creditcardinfo where id =41)
but am getting only one row with the maxversionno
41 b@r.com s 2465 3 1
so, pleas help me in getting the row i 've specified above.
any help will be appreciated.
SELECT distinct(ccno) FROM creditcardinfo
B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- sql query problem with MS Access and C# (C#)
- database connection(select ,insert query) within javascript function (JSP)
- Select Query Problem in access (MS Access and FileMaker Pro)
- SELECT query only of jobids with tagids from all catids (MS SQL)
- Problems in QUERY (Visual Basic 4 / 5 / 6)
- member group query (MySQL)
- hav a problem with this query (MySQL)
Other Threads in the MS SQL Forum
- Previous Thread: Sql Server 2008
- Next Thread: Slow SQL performance over internet


Linear Mode