Personal computing discussed
Moderators: renee, SecretSquirrel, just brew it!
A view definition is subject to the following restrictions: The SELECT statement cannot refer to system or user variables.
If the view needs an ID for some reason, does the table storing users not have its own primary key?
|FN|Steel wrote:If the view needs an ID for some reason, does the table storing users not have its own primary key?
It doesn't. I have no idea if this is poor design or not at my knowledge level.
SUBSTR((UNIX_TIMESTAMP(`vmail`.`mailbox`.`created`) -
CHAR_LENGTH(`vmail`.`mailbox`.`password`)), -(8)) AS `ID`,
MD5(`vmail`.`mailbox`.`username`) AS `ID`,
Check your users (emails?) table to see if it has an integer, auto-increment column.
I would NOT advise using that MD5 hack. Read up on hash collisions
|FN|Steel wrote:Kewl. I'll look into it in a bit. I just completely **** over the webmail client trying to get a calendar running. Yay!
select
column1,
column2,
...
(select count(*) from yourTable where column1 + column2 <= a.column1 + a.column2) as ID
from
yourTable a
Flying Fox wrote:Since there are github issues on this, are you looking at some open source stuff?
pikaporeon wrote:Was somebody writing changes directly to prod? ; )
(One of those key rules to avoid right next to 'don't drink and DBA')