Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.71 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Subsonic 3.0.0.3 getting distinct items on column name. ActiveRecord
  2. CREATE TABLE [dbo].[CityDistancesMin](
  3.     [Id] int identity(1,1) not null,
  4.     [City1] [int] NOT NULL,
  5.     [City2] [int] NOT NULL,
  6.     [Car] [nvarchar](50) NOT NULL,
  7.     [Distance] [int] NOT NULL,
  8. CONSTRAINT [PK_CityDistancesMin] PRIMARY KEY CLUSTERED
  9. (
  10.     [Id] ASC
  11. ) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,
  12.     ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON)
  13. ON [PRIMARY]
  14.        
  15. SqlQuery query = new Select(CityDistancesMinTable.City1Column)
  16.     .From< CityDistancesMinTable>();
  17.      query.Aggregates = new List<Aggregate> {
  18.           new Aggregate(CityDistancesMinTable.City1Column, AggregateFunction.GroupBy)
  19.      };