Skip to content
Advertisement

Can we hide some rows in MySQL?

Say we retrieve table data from a php code.

1- Without delete and restore particular rows from the table and,
2- Without having a column “hidden” (values are 0 or 1) and using the query
SELECT ..... WHERE....AND hidden=0

Is it possible to temporary “hide” some of the rows ?
Or else what is the best way to do it ?

Advertisement

Answer

An alternative would be to create a VIEW which does not include the unwanted rows; that might be better if the requirement is of a (semi-)permanent nature. See here for more.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement