<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Querying &#8211; SQLpowered.com</title>
	<atom:link href="https://sqlpowered.com/command-category/queriyng/feed/" rel="self" type="application/rss+xml" />
	<link>https://sqlpowered.com</link>
	<description>SQL Server + BI</description>
	<lastBuildDate>Tue, 22 Jul 2025 11:23:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://sqlpowered.com/wp-content/uploads/2020/07/FavIcon-e1594067873682-99x100.png</url>
	<title>Querying &#8211; SQLpowered.com</title>
	<link>https://sqlpowered.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>VALUES</title>
		<link>https://sqlpowered.com/t-sql-commands/values/</link>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 11:23:26 +0000</pubDate>
				<category><![CDATA[T-SQLpowered]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?post_type=t-sql-commands&#038;p=5749</guid>

					<description><![CDATA[SELECT from VALUES: SELECT * FROM (VALUES (1), (2)) a (Id) &#160;]]></description>
										<content:encoded><![CDATA[<p>SELECT from VALUES:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT * FROM (VALUES (1), (2)) a (Id)</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SELECT INTO</title>
		<link>https://sqlpowered.com/t-sql-commands/select-into/</link>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Mon, 12 Sep 2022 13:26:02 +0000</pubDate>
				<guid isPermaLink="false">https://sqlpowered.com/?post_type=t-sql-commands&#038;p=5501</guid>

					<description><![CDATA[Backup the entire table into a new table: SELECT * INTO [dbo].[NewTable] FROM [dbo].[ExistingTable] Select only particular columns into the new table or rename existing columns to new names: SELECT [Col1], [Col2] AS [NewCol2Name] INTO [dbo].[NewTable] FROM [dbo].[ExistingTable] Limit and filter the number of rows in the new table using...]]></description>
										<content:encoded><![CDATA[<p>Backup the entire table into a new table:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT *
	INTO [dbo].[NewTable]
FROM [dbo].[ExistingTable]</pre>
<p>Select only particular columns into the new table or rename existing columns to new names:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT [Col1], [Col2] AS [NewCol2Name]
	INTO [dbo].[NewTable]
FROM [dbo].[ExistingTable]</pre>
<p>Limit and filter the number of rows in the new table using TOP and WHERE:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT TOP(10) *
	INTO [dbo].[NewTable]
FROM [dbo].[ExistingTable]
WHERE [Col1] = 'Value'</pre>
<p>Create a new IDENTITY column:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT 
	IDENTITY(INT,1,1) AS [Id]
	INTO [dbo].[New_Table]
FROM [dbo].[Existing_Table]
GO</pre>
<p>Copy table data to a new table in a different filegroup (SQL Server 2016 SP2 and higher):</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT *
	INTO [dbo].[NewTable] ON [DifferentFilegroup]
FROM [dbo].[ExistingTable]</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SELECT &#8211; Basic</title>
		<link>https://sqlpowered.com/t-sql-commands/select-basic/</link>
		
		<dc:creator><![CDATA[Jan Dvořák]]></dc:creator>
		<pubDate>Sun, 26 Dec 2021 21:53:01 +0000</pubDate>
				<category><![CDATA[T-SQLpowered]]></category>
		<guid isPermaLink="false">https://sqlpowered.com/?post_type=t-sql-commands&#038;p=5240</guid>

					<description><![CDATA[Select constant value: SELECT 1 -- number SELECT 'A' -- character SELECT 1, 'A' -- multiple values Select expression: SELECT 1 + 1 SELECT 'A' + 'A' SELECT LEFT('ABC', 1) + 'BC' Use an asterisk to show all columns: SELECT * FROM sys.tables Select specific columns: SELECT [object_id], [name] FROM...]]></description>
										<content:encoded><![CDATA[<p>Select constant value:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT 1 -- number
SELECT 'A' -- character
SELECT 1, 'A' -- multiple values</pre>
<p>Select expression:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT 1 + 1 
SELECT 'A' + 'A' 
SELECT LEFT('ABC', 1) + 'BC'</pre>
<p>Use an asterisk to show all columns:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT *
FROM sys.tables</pre>
<p>Select specific columns:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT [object_id], [name]
FROM sys.tables</pre>
<p>Alias columns (with or without AS):</p>
<pre class="EnlighterJSRAW" data-enlighter-language="sql">SELECT [object_id] [Id_Of_The_Table], [name] AS [Name_Of_The_Table]
FROM sys.tables</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
