title: sql server query: how to select customers with more than 1 order
body: <p>I am a sql server newbie and trying to select all the customers which have more than 1 orderid. The table looks as follows:</p>
  
  <pre><code>CREATE TABLE [dbo].[orders](
      [customerid] [int] NULL,
      [orderid] [int] NULL
  ) ON [PRIMARY]
  GO
  INSERT [dbo].[orders] ([customerid], [orderid]) VALUES (1, 2)
  INSERT [dbo].[orders] ([customerid], [orderid]) VALUES (1, 3)
  INSERT [dbo].[orders] ([customerid], [orderid]) VALUES (2, 4)
  INSERT [dbo].[orders] ([customerid], [orderid]) VALUES (2, 5)
  INSERT [dbo].[orders] ([customerid], [orderid]) VALUES (3, 1)
  </code></pre>