Skip to content

ErcanOPAK.com

  • ASP.Net WebForms
  • ASP.Net MVC
  • C#
  • SQL
  • MySQL
  • PHP
  • Devexpress
  • Reportviewer
  • About

Tag: row

SQL

How to get only second or Nth row in Sql Query

- 23.12.21 | 23.12.21 - ErcanOPAK comment on How to get only second or Nth row in Sql Query

In SQL Server 2012+, you can use OFFSET…FETCH. The below query will help you to get 2nd row. But with little changes, you can get the Nth row as well. SELECT <column(s)> FROM <table(s)> ORDER BY <sort column(s)> OFFSET 1 ROWS — Skip this number of rows FETCH NEXT 1 ROWS ONLY; — Return this […]

Continue Reading ..
SQL

How To Get All Row Count For All Tables In SQL Server Database

- 04.08.21 - ErcanOPAK comment on How To Get All Row Count For All Tables In SQL Server Database

SELECT (SCHEMA_NAME(A.schema_id) + ‘.’ + A.Name) AS TableName , SUM(B.rows) AS RecordCount FROM sys.objects A INNER JOIN sys.partitions B ON A.object_id = B.object_id WHERE A.type = ‘U’ GROUP BY A.schema_id, A.Name ORDER BY RecordCount DESC  

Continue Reading ..
SQL

Filter Rows By Max Date in SQL

- 13.01.21 - ErcanOPAK comment on Filter Rows By Max Date in SQL

SELECT m1.Column1, m1.Column2, m1.Column3, r.MaxTime FROM ( SELECT Column1, MAX(TimeColumn) as MaxTime FROM MyTable GROUP BY Column1 ) r INNER JOIN MyTable m1 ON m1.Column1= r.Column1AND m1.TimeColumn = r.MaxTime

Continue Reading ..
SQL

How to concatenate text from multiple rows into a single text string in SQL server?

- 19.04.19 | 22.11.19 - ErcanOPAK comment on How to concatenate text from multiple rows into a single text string in SQL server?

STUFF((SELECT ‘, ‘+ Column1 FROM Table1 FOR XML PATH(”)),1,1,”) AS ConcatenatedColumn StudentName ————- Mary John Sam Alaina Edward Result: Mary, John, Sam, Alaina, Edward

Continue Reading ..
SQL

Get the row number “x” from SQL

- 04.06.18 | 22.11.19 - ErcanOPAK comment on Get the row number “x” from SQL

WITH Records AS (SELECT ROW_NUMBER() OVER(ORDER BY ID_of_your_SQLTable) AS ‘ROW’, * FROM yourSQLTable) SELECT * FROM Records WHERE ROW = X –You can change X with the number you wanna get (For Example ROW = 5 will bring the 5th record)

Continue Reading ..
ASP.Net WebForms

Add RowNumber to Gridview

- 04.06.18 | 22.11.19 - ErcanOPAK comment on Add RowNumber to Gridview

<Columns> <asp:TemplateField HeaderText=”RowNumber”> <ItemTemplate> <%# Container.DataItemIndex + 1 %> </ItemTemplate> </asp:TemplateField> … </Columns>

Continue Reading ..
May 2022
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
« Apr    

Most Viewed Posts

  • Get the First and Last Word from a String or Sentence in SQL (333)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (222)
  • Find numbers with more than two decimal places in SQL (191)
  • How to solve “Response.Redirect cannot be called in a Page callback” for DevExpress Components (190)
  • Confirm before process with ASPxButton in Devexpress (189)
  • ASPxGridView – Disable CheckBox based on condition in GridViewCommandColumn (189)
  • How to make some specific word(s) Bold or Underline in ReportViewer (189)
  • Devexpress ASPxGridview Column Grouping in Code (177)
  • Add Constraint to SQL Table to ensure email contains @ (174)
  • Tense Changes When Using Reported Speech (167)

Recent Posts

  • How to put text inside MVC Razor code block
  • How to solve 0xc0000135 application errors after Windows 11 Update
  • How to get the integrity value for a jquery version of script reference in a web page
  • How to get session value in Javascript
  • How to get value from resx file in C#
  • How to lock the ciritical code part in C#
  • How to make theater mode the default for Youtube
  • How to turn off YouTube annotations and cards
  • How to hide Youtube chat windows permanently
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server

Recent Posts

  • How to put text inside MVC Razor code block
  • How to solve 0xc0000135 application errors after Windows 11 Update
  • How to get the integrity value for a jquery version of script reference in a web page
  • How to get session value in Javascript
  • How to get value from resx file in C#

Most Viewed Posts

  • Get the First and Last Word from a String or Sentence in SQL (333)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (222)
  • Find numbers with more than two decimal places in SQL (191)
  • How to solve “Response.Redirect cannot be called in a Page callback” for DevExpress Components (190)
  • Confirm before process with ASPxButton in Devexpress (189)

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter

powered by XBlog Plus WordPress Theme