Jump to content
Server Maintenance This Week. ×

Trying to figure out the proper query...


This topic is 4366 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Ok this code is not correct.

I am looking into my history table and wish to find all partyUIDs of

people who haven't renewed yet, for a given chapter / season.

Note: Season year is just a 4 digit year.

I think i need a join?


Let ( [ $a = system::SEASONYEAR ;

$b = $a -1 ;

$c = system::CHAPTER

];



ExecuteSQL (

"SELECT partyUID FROM history WHERE seasonYear = ? and Chapter = ?

UNION SELECT partyUID from history WHERE seasonYear <> ? and Chapter = ?

" ; "" ; ""  ; $b; $c  ; $a ; $c )





Link to comment
Share on other sites

Try this:

Let ( [ $a = system::SEASONYEAR ;

$b = $a -1 ;

$c = system::CHAPTER

];

ExecuteSQL (

"SELECT partyUID FROM history WHERE seasonYear = ? and Chapter = ?

AND NOT IN SELECT partyUID from history WHERE seasonYear = ? and Chapter = ?

" ; "" ; "" ; $b; $c ; $a ; $c )

Link to comment
Share on other sites

This topic is 4366 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.