JohKa
JohKa

Reputation: 11

Dovecot SQL Query Error - Why?

SELECT CONCAT('maildir:/var/vmail/',maildir) AS mail,
       5000 AS uid, 
       5000 AS gid 
FROM mailbox 
INNER JOIN domain 
WHERE username = '[email protected]'
  AND mailbox.active = '1'
  AND domain.active = '1'   

What's wrong with this query? Postgresql says:

'ERROR:  syntax error at or near "WHERE" 
LINE 1: ...S uid, 5000 AS gid FROM mailbox INNER JOIN domain WHERE user...'

Upvotes: 1

Views: 156

Answers (1)

heximal
heximal

Reputation: 10517

try this

SELECT CONCAT('maildir:/var/vmail/',maildir) AS mail,
       5000 AS uid,
       5000 AS gid
FROM mailbox
INNER JOIN DOMAIN on
  username = '[email protected]'
  AND mailbox.active = '1'
  AND DOMAIN.active = '1'

Upvotes: 0

Related Questions