FN-FORUM: SQL Question
date posted 30th December 2007 22:50
Hi all
Happy Nearly New Year.
I have an SQL statement, a really simple one, which selects the distinct
product numbers (SKU) from a list of pages viewed by a visitor.
I just noticed that the original one I was using only showed the first 3
pages ever viewed and not the most recent (4,5,6,7..) and tried to re-order
by using this:
select distinct sku, pvID from pageview where sku is not null and sku !=0
and AID = '#cookie.AID#' and sku != #sku# order by pvID desc
Where pvID is the PageView ID (just an autoincrement field) however, the SKU
is not distinct in this format and we get repeating entires if someone has
seen the same product twice recently
How can I force the query to start at the bottom of the table (ie most
recent views)?