![]() |
MySQL select
I'm using the vbulletin db classes.
I want to select field19 from users where users is member of group 15 and last activity was within 30 days. Anybody know how to do this? --------------- Added [DATE]1224909756[/DATE] at [TIME]1224909756[/TIME] --------------- Got this far: SELECT user.userid, userfield.field19 FROM user INNER JOIN userfield ON user.userid = userfield.userid WHERE ( user.membergroupids LIKE 15 OR user.usergroupid LIKE 15 ) AND userfield.field19 != ''; Just have to work out how to do the dates. |
Quote:
select u.userid, uf.field19 from user u join userfield uf using (userid) where find_in_set('15',u.membergroupids) > 0 and to_days(now()) - to_days(from_unixtime(u.lastactivity)) <= 30 [/sql] |
All times are GMT. The time now is 08:17 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|