Subject | Re: MS SQL to FireBird |
---|---|
Author | Svein Erling Tysvær |
Post date | 2005-11-24T08:12:57Z |
--- In firebird-support@yahoogroups.com, "polash26" wrote:
that you cannot have two FROMs after eachother, and that you should
alias all tables. So try something like:
DELETE FROM T1 T1a
WHERE
(SELECT COUNT(*) FROM T1 T1b WHERE T1b.ID = T1a.ID) >
(SELECT b.Recent FROM T2 b WHERE b.ID = T1a.ID)
Hmm, I've never tried anything like this and have no idea whether it
will work. Nor do I know whether this is what you want to do, but at
least I hope this helps,
Set
>Like Miroslav, I don't get what you're trying to do, but I do know
> --- In firebird-support@yahoogroups.com, "Miroslav Penchev" wrote:
> >
> > On Sun, 20 Nov 2005 12:13:27 +0200, polash26 wrote:
> >
> > > What is the equivalent query in FireBird for the following MS
> > > SQL query
> > >
> > > DELETE FROM T1
> > > FROM T2 b
> > > WHERE
> > > ( SELECT COUNT(*) FROM T1 a WHERE a.ID = b.ID ) > b.Recent
> > >
> > > Thanks for any reply.
> > >
> > >
> >
> > What should do that DELETE?
>
> Delete will delete data from T1, according to the where condition
> (WHERE( SELECT COUNT(*) FROM T1 a WHERE a.ID = b.ID ) > b.Recent ).
that you cannot have two FROMs after eachother, and that you should
alias all tables. So try something like:
DELETE FROM T1 T1a
WHERE
(SELECT COUNT(*) FROM T1 T1b WHERE T1b.ID = T1a.ID) >
(SELECT b.Recent FROM T2 b WHERE b.ID = T1a.ID)
Hmm, I've never tried anything like this and have no idea whether it
will work. Nor do I know whether this is what you want to do, but at
least I hope this helps,
Set