Is it possible in a query to delete a row specifying its row index? I want to delete a row from my table. I'm trying to figure this because when I delete rows from my datagridview, it does not update. So I was thinking if I just directly delete it from sql then it's just like calling a query.
harcaype
0
Light Poster
Recommended Answers
Jump to PostYour table must have a primary key... use this to delete that required row. The row number will change depending on which column you order your table.
Say that you have a table with id as primary key and date (you order your records according to date). You want …
Jump to PostRow is an alias for
row_number() over (order by someColumn)
To be precise:
( select *, row_number() over (order by date) as row from exampleTable )
Will give you every row from your example table with its row number according to column of your …
All 5 Replies
wujtehacjusz
2
Newbie Poster
harcaype
0
Light Poster
wujtehacjusz
2
Newbie Poster
harcaype
0
Light Poster
wujtehacjusz
2
Newbie Poster
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.