<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.dotnetzone.gr:443/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Πρώτα Βήματα - Βάσεις δεδομένων</title><link>https://www.dotnetzone.gr:443/cs/forums/73/ShowForum.aspx</link><description>Για όσους κάνουν τα πρώτα τους βήματα στην Microsoft Access ή τον SQL Server, ή γενικότερα στη θεωρία βάσεων δεδομένων.</description><dc:language>el</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Απ: βοηθεια με sql select</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/60741.aspx</link><pubDate>Mon, 01 Nov 2010 22:52:30 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:60741</guid><dc:creator>spaceman</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/60741.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=73&amp;PostID=60741</wfw:commentRss><description>&lt;PRE&gt;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:black;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--products table&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;DECLARE&lt;/SPAN&gt; @tblProducts &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;TABLE&lt;/SPAN&gt; (PID &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SMALLINT&lt;/SPAN&gt;, 
			Name &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;VARCHAR&lt;/SPAN&gt;(10), 
			Price &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;MONEY&lt;/SPAN&gt;)

&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;INTO&lt;/SPAN&gt; @tblProducts(PID, Name, Price)
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;VALUES&lt;/SPAN&gt; (1, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'t1'&lt;/SPAN&gt;, 1), (2, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'t2'&lt;/SPAN&gt;, 11), (3, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'t3'&lt;/SPAN&gt;, 22), (4, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'t4'&lt;/SPAN&gt;, 33), (5, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'t5'&lt;/SPAN&gt;, 44)

&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--shipments table&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;DECLARE&lt;/SPAN&gt; @tblShipping &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;TABLE&lt;/SPAN&gt;(ShipID &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SMALLINT&lt;/SPAN&gt;, 
			TypeID &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SMALLINT&lt;/SPAN&gt;, 
			PID &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SMALLINT&lt;/SPAN&gt;, 
			Price &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;MONEY&lt;/SPAN&gt;)
							
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;INTO&lt;/SPAN&gt; @tblShipping(ShipID, TypeID, PID, Price)
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;VALUES&lt;/SPAN&gt; (1, 1, 1, 12), (2, 2, 1, 14), (3, 4, 1, 15), (4, 1, 2, 11), (5, 3, 2, 11), (6, 4, 2, 11), 
(7, 1, 3, 11), (8, 2, 3, 11), (9, 3, 3, 11), (10, 1, 4, 12), (11, 5, 5, 13)




&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--table grouping products that should have common shipment types&lt;/SPAN&gt;
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;DECLARE&lt;/SPAN&gt; @prodgroups &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;TABLE&lt;/SPAN&gt;(PID &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SMALLINT&lt;/SPAN&gt;, groupID &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:fuchsia;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;CHAR&lt;/SPAN&gt;(1))
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;INTO&lt;/SPAN&gt; @prodgroups(PID, groupID) 
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;VALUES&lt;/SPAN&gt; (1, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'a'&lt;/SPAN&gt;), (2, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'a'&lt;/SPAN&gt;), (4, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'a'&lt;/SPAN&gt;), &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--get common shipment types for the combination of products: 1, 2, 4&lt;/SPAN&gt;
		(2, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'b'&lt;/SPAN&gt;),(3, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'b'&lt;/SPAN&gt;), &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--get common shipment types for the combination of products: 2, 3&lt;/SPAN&gt;
		(1, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'c'&lt;/SPAN&gt;), (5, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:red;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;'c'&lt;/SPAN&gt;) &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--get common shipment types for the combination of products: 1, 5&lt;/SPAN&gt;


&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SELECT&lt;/SPAN&gt; groupprods.groupID, groupshipments.TypeID
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;FROM&lt;/SPAN&gt;
	(&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--get counter of services per group&lt;/SPAN&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SELECT&lt;/SPAN&gt; groupID, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:fuchsia;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;COUNT&lt;/SPAN&gt;(&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;DISTINCT&lt;/SPAN&gt; PID) &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AS&lt;/SPAN&gt; groupprodcounter
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;FROM&lt;/SPAN&gt; @prodgroups
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;GROUP&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;BY&lt;/SPAN&gt; groupID 
	)&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AS&lt;/SPAN&gt; groupprods 
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:fuchsia;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;LEFT&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:silver;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;JOIN&lt;/SPAN&gt; 			
	(&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:teal;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--get counter of shipped products per group and shipment type&lt;/SPAN&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;SELECT&lt;/SPAN&gt; pgrp.groupID, shp.TypeID, &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:fuchsia;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;COUNT&lt;/SPAN&gt;(&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;DISTINCT&lt;/SPAN&gt; shp.PID) &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AS&lt;/SPAN&gt; shipmentprodcounter
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;FROM&lt;/SPAN&gt; @prodgroups &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AS&lt;/SPAN&gt; pgrp
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:silver;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;JOIN&lt;/SPAN&gt; @tblShipping &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AS&lt;/SPAN&gt; shp &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ON&lt;/SPAN&gt; pgrp.PID = shp.PID
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;GROUP&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;BY&lt;/SPAN&gt; pgrp.groupID, shp.TypeID
	) &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AS&lt;/SPAN&gt; groupshipments &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ON&lt;/SPAN&gt; groupprods.groupID = groupshipments.groupID &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:silver;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;AND&lt;/SPAN&gt; groupprods.groupprodcounter = groupshipments.shipmentprodcounter
&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;ORDER&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:blue;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;BY&lt;/SPAN&gt; groupprods.groupID&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="BACKGROUND-COLOR:transparent;FONT-FAMILY:Courier New;COLOR:black;FONT-SIZE:11px;FONT-WEIGHT:normal;"&gt;--HTH--&lt;/SPAN&gt;&lt;/PRE&gt;</description></item><item><title>βοηθεια με sql select</title><link>https://www.dotnetzone.gr:443/cs/forums/thread/60691.aspx</link><pubDate>Wed, 27 Oct 2010 22:15:30 GMT</pubDate><guid isPermaLink="false">2622095e-976c-431a-859e-16783ec7ecd7:60691</guid><dc:creator>DaltonGR</dc:creator><slash:comments>0</slash:comments><comments>https://www.dotnetzone.gr:443/cs/forums/thread/60691.aspx</comments><wfw:commentRss>https://www.dotnetzone.gr:443/cs/forums/commentrss.aspx?SectionID=73&amp;PostID=60691</wfw:commentRss><description>καλημέρα,&lt;br&gt;έχω 2 πίνακες,&lt;br&gt;&lt;br&gt;tblProducts&lt;br&gt;PID&lt;br&gt;Name&lt;br&gt;Price&lt;br&gt;&lt;br&gt;tblShipping&lt;br&gt;ShipID&lt;br&gt;TypeID&lt;br&gt;PID&lt;br&gt;Price&lt;br&gt;&lt;br&gt;με τα εξής δεδομένα&lt;br&gt;tblProducts&lt;br&gt;1,2,3,4&lt;br&gt;t1,t2,t3,t4&lt;br&gt;1,11,22,33&lt;br&gt;&lt;br&gt;tblShipping&lt;br&gt;1,2,3,4,5,6,7,8,9,10&lt;br&gt;1,2,4,1,3,4,1,2,3,1&lt;br&gt;1,1,1,2,2,2,3,3,3,4&lt;br&gt;12,14,15,11,11,11,11,11,11,12&lt;br&gt;&lt;br&gt;με λίγα λόγια έχω κάποια προϊόντα που υποστηρίζουν κάπιοες μέθοδοι αποστολής. Τα προϊόντα δεν έχουν τον ίδιο τρόπο αποστολής αλλα έχουν μερικά κοινά.&lt;br&gt;Πώς μπορώ να πάρα τους κοινούς τρόπους αποστολής για τα προϊόντα που θέλω;&lt;br&gt;&lt;br&gt;Ευχαριστώ εκ των προτέρων.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item></channel></rss>