Någon som kan hjälpa mig att slå ihop och optimera dessa SQL satser?
Set Rs = Connect.Execute("SELECT COUNT(username) As online FROM members Where status = 'online'")
online=Rs(0)
Rs.Close : Set Rs = Nothing
Set Rs = Connect.Execute("SELECT COUNT(id) As chatt FROM chatt_online")
chatt=Rs(0)
Rs.Close : Set Rs = Nothing
Set Rs = Connect.Execute("SELECT COUNT(messageid) As mess from mailin WHERE last=0 AND till='" & id & "'")
If not Rs.EOF Then
nytt=Rs(0)
End If
Rs.Close : Set Rs = Nothing
Set Rs = Connect.Execute("SELECT COUNT(ID) FROM gb As gb WHERE last=0 AND till='" & id & "'")
If not Rs.EOF Then
nytt = nytt + Rs(0)
End If
Rs.Close : Set Rs = Nothing
Tusen tack i förväg.