Update query with last table input

Asked

Viewed 22 times

0

How do I update a query with data that was entered in the BD after the last query?

Simple example is a social network: You are viewing existing data, and when there is a new post, this is inserted in the top of the current view.

  • Using SELECT [field] FROM [data_base].[dbo].[table] ORDER BY [filed] DESC or, instead of DESC use ASC. This using SQL Server, but the clause ORDER BY [field] ASC/DESC is from the SQL language.

  • @Eduardoalmeida I think that’s not quite what he just wants to know. This query only orders the table. He wants to know how to check new "updates" in the table, via the informed languages.

  • In that case, he only needs to wear one set_timeout() to require from the database every X seconds or minutes a new update. All done by AJAX. See also Historyjs. https://github.com/balupton/history.js

  • When it comes to consultation, it’s quiet. But I could not implement a "flag" referencing and saving the time of the last query and when to use set_timeout() for the next query, collect only the new entries from.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.