Quantcast
Channel: SQL Server SELECT LAST N Rows - Stack Overflow
Viewing all articles
Browse latest Browse all 24

Answer by gabrielkolbe for SQL Server SELECT LAST N Rows

$
0
0

IF you use php and mysql combine it like so:

$find = $db->prepare("SELECT count(id) as countaggre FROM analytics_aggregate");      $find->execute();      $countaggregates = $find->fetch(PDO::FETCH_ASSOC);      if($countaggregates['countaggre'] > 12) { $start = $countaggregates['countaggre'] - 12; } else { $start = 0; }      $find = $db->prepare("SELECT * FROM analytics_aggregate ORDER BY id ASC LIMIT ".$start.", 12");

Viewing all articles
Browse latest Browse all 24

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>