Android Question SQL query question

anaylor01

Well-Known Member
Licensed User
Longtime User
The below query isn't returning anything. How can I get it to return something?
B4X:
If  SQL1.ExecQuerySingleResult("SELEct  ifnull(COUNT(*),'0') FROM  GamePlay GROUP BY   teamscore, teamround HAVING    COUNT(*) > 1") > 1 Then
 

LWGShane

Well-Known Member
Licensed User
Longtime User
Maybe this?
B4X:
Dim Score As Int
Int = SQL1.ExecQuerySingleResult("Query")
If Score > 1 Then
'Your logic here.
End If
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
I have to ask. What is the point of the IFNULL function if it doesn't do anything. I have tired it with integers, strings. I can't get it to return anything.
 
Upvote 0

anaylor01

Well-Known Member
Licensed User
Longtime User
I have an empty table and I need to check to see if it is empty. But any SQL I write just gets the java.lang.NumberFormatException: Invalid double: "null" error. There should be some way to do this with a simple statement like below.
if SQL1.ExecQuerySingleResult("SELECT sum(ifnull(timeleft,'0')) from tbltemplate") > "0" Then
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
try

SELEct COUNT(*) FROM GamePlay GROUP BY teamscore, teamround

SELECT count(*) from tbltemplate where timeleft=0
 
Upvote 0
Top