REATE TABLE [dbo].[BiddingTable](
[cAuctionId] [int] NULL,
[idUserId] [int] NULL,
[cItemId] [int] NULL,
[vcBidamount] [nvarchar](50) NULL,
[vcBidcount] [int] NULL,
[bidQty] [varchar](5) NULL,
[vcBidtime] [datetime] NULL,
[status] [varchar](50) NULL
) ON [PRIMARY]
INSERT [dbo].[BiddingTable] ([cAuctionId], [idUserId], [cItemId], [vcBidamount], [vcBidcount], [bidQty], [vcBidtime], [status]) VALUES (10, 36, 21, N'93.6', 1, N'0', CAST(0x0000A05500F83B44 AS DateTime), N'Accepted')
INSERT [dbo].[BiddingTable] ([cAuctionId], [idUserId], [cItemId], [vcBidamount], [vcBidcount], [bidQty], [vcBidtime], [status]) VALUES (10, 5, 21, N'93.7', 4, N'0', CAST(0x0000A055010411BC AS DateTime), N'Accepted')
INSERT [dbo].[BiddingTable] ([cAuctionId], [idUserId], [cItemId], [vcBidamount], [vcBidcount], [bidQty], [vcBidtime], [status]) VALUES (10, 36, 21, N'93.8', 5, N'0', CAST(0x0000A05501086D5C AS DateTime), N'Accepted')
INSERT [dbo].[BiddingTable] ([cAuctionId], [idUserId], [cItemId], [vcBidamount], [vcBidcount], [bidQty], [vcBidtime], [status]) VALUES (10, 5, 21, N'93.8', 6, N'0', CAST(0x0000A055010ABD28 AS DateTime), N'Accepted')
INSERT [dbo].[BiddingTable] ([cAuctionId], [idUserId], [cItemId], [vcBidamount], [vcBidcount], [bidQty], [vcBidtime], [status]) VALUES (10, 36, 21, N'93.9', 7, N'0', CAST(0x0000A055010AF7C0 AS DateTime), N'Accepted')
INSERT [dbo].[BiddingTable] ([cAuctionId], [idUserId], [cItemId], [vcBidamount], [vcBidcount], [bidQty], [vcBidtime], [status]) VALUES (10, 5, 21, N'93.9', 8, N'0', CAST(0x0000A05600BF8614 AS DateTime), N'Accepted')
INSERT [dbo].[BiddingTable] ([cAuctionId], [idUserId], [cItemId], [vcBidamount], [vcBidcount], [bidQty], [vcBidtime], [status]) VALUES (10, 36, 21, N'94', 9, N'0', CAST(0x0000A05600C0231C AS DateTime), N'Accepted')
I want result as below
Assign Highest Rank of based on Max BidAmount.
if Bid Amount gets tie with other user then who ever enter bid amount first he will get the high Rank..Mean based on Bidtime Rank will assign.
pritesh2010 30 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.