Jump to content

Do stuff instead of column


Azu

Recommended Posts

Can somebody please tell me how I can change my database so that it will do something else when a certain column is used (which isn't actually in that table)?

 

Like for example so that

select `MOO` from `database`.`table`

would act like

select substring_index(`row`,' ',99)as `MOO` from `database`.`table`

?

Link to comment
https://forums.phpfreaks.com/topic/54860-do-stuff-instead-of-column/
Share on other sites

I'm not sure that you'll be able to find anything like that in MySQL. This DB doesn't support functions like PostgreSQL or some other heavier weight database systems do. You may get by with creating a view that contains the definition of the column that you are after and simply selecting the column from the view instead.

 

Hope this helps.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.