--- a/System.Data.SQLite.Linq/SQL Generation/SqlSelectStatement.cs
+++ b/System.Data.SQLite.Linq/SQL Generation/SqlSelectStatement.cs
@@ -16,13 +16,14 @@
 
   /// <summary>
   /// A SqlSelectStatement represents a canonical SQL SELECT statement.
-  /// It has fields for the 5 main clauses
+  /// It has fields for the 6 main clauses
   /// <list type="number">
   /// <item>SELECT</item>
   /// <item>FROM</item>
   /// <item>WHERE</item>
   /// <item>GROUP BY</item>
   /// <item>ORDER BY</item>
+  /// <item>LIMIT</item>
   /// </list>
   /// We do not have HAVING, since it does not correspond to anything in the DbCommandTree.
   /// Each of the fields is a SqlBuilder, so we can keep appending SQL strings
@@ -165,6 +166,29 @@
         }
         return orderBy;
       }
+    }
+
+    private string limit;
+    public string Limit
+    {
+      get
+      {
+        return limit;
+      }
+
+      set
+      {
+        limit = value;
+      }
+    }
+
+    private string offset;
+    public string OffSet
+    {
+      get
+      { return offset; }
+      set
+      { offset = value; }
     }
 
     //indicates whether it is the top most select statement, 
@@ -299,6 +323,25 @@
         this.OrderBy.WriteSql(writer, sqlGenerator);
       }
 
+      if ((null != this.limit) && this.limit.Length != 0) //&& (this.IsTopMost || this.Top != null))
+      {
+        writer.WriteLine();
+        writer.Write(string.Format("LIMIT {0} ", limit));
+      }
+
+      if ((null != this.offset) && this.offset.Length != 0)// && (this.IsTopMost || this.Top != null))
+      {
+
+        if (this.limit != null && this.limit.Length != 0)
+          writer.Write(string.Format("OFFSET {0} ", offset));
+        else
+        {
+          writer.WriteLine();
+          writer.Write(string.Format("LIMIT 8999999999999999999 OFFSET {0} ", offset));
+        }
+
+      }
+
       if (this.Top != null)
       {
         this.Top.WriteSql(writer, sqlGenerator);