Using an auto_increment sequence for cursor purpose in mysql ? Any other Alternative?

35
February 11, 2019, at 07:30 AM

I m creating a application where there are users and posts, and user can likes posts, so i have created a table ,

create table post_has_likes(
    post_id int,
    user_id int,
    sequence int auto_increment
)Engine = Innodb;

so in application when user want to see, who other users has liked some post, i can query this table, and can use sequence as cursor for next page ? i want to know is that good idea ? what is standard solution ? i don't want to use left ? thanks

READ ALSO
MySQL - Using COALESCE with DATE_ADD and DATE_SUB to get next/previous record

MySQL - Using COALESCE with DATE_ADD and DATE_SUB to get next/previous record

I am trying to query MySQL to select the previous and next recordI need help in using COALESCE and DATE_ADD/DATE_SUB together

54
How to upgrade MySQL database schema in respective to sprint releases?

How to upgrade MySQL database schema in respective to sprint releases?

let say we have a Qt/qml based desktop application, this is using mysql as local db

47
Grant MySQL permissions on current database?

Grant MySQL permissions on current database?

I can grant permissions with a static database name in the GRANT statement

37
MySql Login error - Domain name added automatically with the user name

MySql Login error - Domain name added automatically with the user name

I am on Windows 10 desktop with a Cloudera VM running on itFrom inside the coudera vm Linux OS, I can login to MySQL with:

48