Re: How to make so I only need to specify the id once..

2005-02-22 Thread SGreen
"Martijn Tonies" <[EMAIL PROTECTED]> wrote on 02/21/2005 10:20:28 AM: > > > > Hi, > > why not try: > > SELECT COUNT(s.Id)+COUNT(se.Id) > > FROM subs s > > INNER JOIN subs_erased se ON s.Id=se.Id > > WHERE s.Id=1; > > > > /Johan > > This won't return the same result if there's no entries > in "s

Re: How to make so I only need to specify the id once..

2005-02-21 Thread Johan Höök
Hi Martijn, yes of course you're right but SELECT COUNT(s.Id)+ (SELECT COUNT(se.Id) FROM subs_erased se WHERE s.Id=se.Id) FROM subs s WHERE s.Id=1 might work, at least in 4.1.x. I did test it with 4.1.9. /Johan Martijn Tonies wrote: Hi, why not try: SELECT COUNT(s.Id)+COUNT(se.Id) FROM subs

Re: How to make so I only need to specify the id once..

2005-02-21 Thread Martijn Tonies
> Hi, > why not try: > SELECT COUNT(s.Id)+COUNT(se.Id) > FROM subs s > INNER JOIN subs_erased se ON s.Id=se.Id > WHERE s.Id=1; > > /Johan This won't return the same result if there's no entries in "subs_erased" for the ID = 1. With regards, Martijn Tonies Database Workbench - developer tool fo

Re: How to make so I only need to specify the id once..

2005-02-21 Thread Johan Höök
Hi, why not try: SELECT COUNT(s.Id)+COUNT(se.Id) FROM subs s INNER JOIN subs_erased se ON s.Id=se.Id WHERE s.Id=1; /Johan Joppe A wrote: Hello, I have a small problem that is probably easy to fix but it is to advanced for me as a "newbe". In my sql-query (below) have I the ID specified twice, I wo

How to make so I only need to specify the id once..

2005-02-21 Thread Joppe A
Hello, I have a small problem that is probably easy to fix but it is to advanced for me as a "newbe". In my sql-query (below) have I the ID specified twice, I wonder if there is a easy way to solve it so I only need to write my ID once in the query? SELECT (SELECT COUNT(*) FROM subs WHERE id=1