- From
- On
- Join
- Where
- Group By
- with cube
- Having
- Select
- Distinct
- Order By
- Top
This blog is created to be able to help software developers searching specific information.
Showing posts with label Sql. Show all posts
Showing posts with label Sql. Show all posts
Thursday, November 5, 2015
Monday, December 1, 2014
Sql Query Statement Execution Order
FROM
ON
JOIN
WHERE
GROUP BY
WITH CUBE or WITH ROLLUP
HAVING
SELECT
DISTINCT
ORDER BY
TOP
ON
JOIN
WHERE
GROUP BY
WITH CUBE or WITH ROLLUP
HAVING
SELECT
DISTINCT
ORDER BY
TOP
Sunday, October 20, 2013
tsql foreach sample
declare @id int <-- change your primary key type if necessary
Declare c Cursor For Select Distinct {your primary key} From {your table}
Open c
Fetch next From c into @id
While @@Fetch_Status=0 Begin
--do operations here
Fetch next From c into @id
End
Close c
Deallocate c
Declare c Cursor For Select Distinct {your primary key} From {your table}
Open c
Fetch next From c into @id
While @@Fetch_Status=0 Begin
--do operations here
Fetch next From c into @id
End
Close c
Deallocate c
Subscribe to:
Posts (Atom)