Re: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Cornie van Schoor
>>> I have query which extract the sales per day from a table > > >>> > >>> Select EXTRACT(YEAR from DT) as YEARNO, EXTRACT(YEARDAY from DT) > AS DAYNO, SUM(DUE) from CLIENT_INVOICES group by YEARNO, WEEKNO. > >>> > >>> It works 100%, but only returns the dates with sales, I need it to > also in

Re: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Alexandre Benson Smith
Em 24/10/2012 20:37, Doug Chamberlin escreveu: > On 10/24/12 6:25 PM, Alexandre Benson Smith wrote: >> Em 24/10/2012 20:21, Doug Chamberlin escreveu: >>> On 10/24/12 5:54 PM, cornievs wrote: I have query which extract the sales per day from a table Select EXTRACT(YEAR from DT) as YEA

Re: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Doug Chamberlin
On 10/24/12 6:25 PM, Alexandre Benson Smith wrote: > Em 24/10/2012 20:21, Doug Chamberlin escreveu: >> On 10/24/12 5:54 PM, cornievs wrote: >>> I have query which extract the sales per day from a table >>> >>> Select EXTRACT(YEAR from DT) as YEARNO, EXTRACT(YEARDAY from DT) AS DAYNO, >>> SUM(DUE)

Re: [firebird-support] Re: Solution for a redundant join?

2012-10-24 Thread Ann Harrison
On Wed, Oct 24, 2012 at 4:34 PM, Jeff wrote: > > > Use tables aliases to include multiple references to a single table. > > > > > > SELECT > > SCHEDULE.DATE_TIME, HomeTeam.TEAM, AwayTeam.Team > > FROM SCHEDULE > > LEFT JOIN TEAMS HomeTeam ON HomeTeam.PRIMARYKEY = SCHEDULE.HOME_TEAMID > > LE

Re: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Alexandre Benson Smith
Em 24/10/2012 20:21, Doug Chamberlin escreveu: > On 10/24/12 5:54 PM, cornievs wrote: >> I have query which extract the sales per day from a table >> >> Select EXTRACT(YEAR from DT) as YEARNO, EXTRACT(YEARDAY from DT) AS DAYNO, >> SUM(DUE) from CLIENT_INVOICES group by YEARNO, WEEKNO. >> >> It wor

Re: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Doug Chamberlin
On 10/24/12 5:54 PM, cornievs wrote: > I have query which extract the sales per day from a table > > Select EXTRACT(YEAR from DT) as YEARNO, EXTRACT(YEARDAY from DT) AS DAYNO, > SUM(DUE) from CLIENT_INVOICES group by YEARNO, WEEKNO. > > It works 100%, but only returns the dates with sales, I need

Re: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Louis Kleiman (SSTMS, Inc.)
But this won't return rows for dates where there is no record in the source table. On Wed, Oct 24, 2012 at 6:02 PM, Leyne, Sean wrote: > ** > > > > > I have query which extract the sales per day from a table > > > > Select EXTRACT(YEAR from DT) as YEARNO, EXTRACT(YEARDAY from DT) AS > > DAYNO, SU

Re: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Alexandre Benson Smith
try something like this: with recursive Datas (Data) as (select Cast('2009-01-01' as Date) From rdb$database union all Select Data + 1 From Datas Where Data + 1 <= Cast('2009-01-31' as Date)) select

RE: [firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread Leyne, Sean
> I have query which extract the sales per day from a table > > Select EXTRACT(YEAR from DT) as YEARNO, EXTRACT(YEARDAY from DT) AS > DAYNO, SUM(DUE) from CLIENT_INVOICES group by YEARNO, WEEKNO. > > It works 100%, but only returns the dates with sales, I need it to also > include > the dates w

[firebird-support] How do you 0/null results to a GROUP BY query

2012-10-24 Thread cornievs
Hi All I have query which extract the sales per day from a table Select EXTRACT(YEAR from DT) as YEARNO, EXTRACT(YEARDAY from DT) AS DAYNO, SUM(DUE) from CLIENT_INVOICES group by YEARNO, WEEKNO. It works 100%, but only returns the dates with sales, I need it to also include the dates with zero

[firebird-support] Re: Solution for a redundant join?

2012-10-24 Thread Jeff
--- In firebird-support@yahoogroups.com, "Leyne, Sean" wrote: > Use tables aliases to include multiple references to a single table. > > > SELECT > SCHEDULE.DATE_TIME, HomeTeam.TEAM, AwayTeam.Team > FROM SCHEDULE > LEFT JOIN TEAMS HomeTeam ON HomeTeam.PRIMARYKEY = SCHEDULE.HOME_TEAMID

Re: [firebird-support] Solution for a redundant join?

2012-10-24 Thread Louis Kleiman (SSTMS, Inc.)
Try using aliases: SELECT SCHEDULE.DATE_TIME, HOME_TEAM.TEAM as HomeTeamName, AWAY_TEAM.TEAM as AwayTeamName FROM SCHEDULE LEFT JOIN TEAMS HOME_TEAM ON SCHEDULE.HOME_TEAMID=HOME_TEAM.PRIMARYKEY LEFT JOIN TEAMS AWAY_TEAM ON SCHEDULE.AWAY_TEAMID=AWAY_TEAM.PRIMARYKEY On Wed, Oct 24, 2012

RE: [firebird-support] Solution for a redundant join?

2012-10-24 Thread Leyne, Sean
> The following simple query produces the results below: > > SELECT SCHEDULE.DATE_TIME, TEAMS.TEAM FROM SCHEDULE LEFT JOIN > TEAMS ON SCHEDULE.HOME_TEAMID=TEAMS.PRIMARYKEY > > ***QUERY RESULTS (Showing 'Home Team' Column)*** > 12/01/2012 TeamA > 12/21/2012 TeamB > 12/25/2012 TeamC > > How do I

[firebird-support] Solution for a redundant join?

2012-10-24 Thread Jeff
The following simple query produces the results below: SELECT SCHEDULE.DATE_TIME, TEAMS.TEAM FROM SCHEDULE LEFT JOIN TEAMS ON SCHEDULE.HOME_TEAMID=TEAMS.PRIMARYKEY ***QUERY RESULTS (Showing 'Home Team' Column)*** 12/01/2012 TeamA 12/21/2012 TeamB 12/25/2012 TeamC How do I include the correspon

RE: [firebird-support] Cannot connect to server under heavy load

2012-10-24 Thread Leyne, Sean
> Cannot connect to server under heavy load. > I get "connection rejected by remote interface" (335544421). > > Is this a bug, ot there is an option in firebird.conft to avoid this? > > > Firebird.log (FB20 Classic Server) > L3S-4 Wed Oct 24 14:04:28 2012 > I/O error for file "C:\PROGRAM

[firebird-support] Re: Cannot connect to server under heavy load

2012-10-24 Thread ma_golyo
Another strange fact : Running 1 application with 250 thread where each thread connects to 2 database and runs 2 select works perfectly, BUT Running 50 application with 5 thread where each thread connects to 2 database and runs 2 select throw errors mentioned eralier. --- In firebird-support@y

[firebird-support] Compound foreign key & null value bug?

2012-10-24 Thread Rick Debay
I'm modifying a foreign key from one column to two. I dropped the original foreign key from the child table, populated the new columns, and then created the new key. I forgot to populate the new column in the child table, so all the relationships looked like this: ChildParent -

[firebird-support] Re: Cannot connect to server under heavy load

2012-10-24 Thread ma_golyo
Now I get "cannot attach to password database" (335544653) error. Same log as first time. --- In firebird-support@yahoogroups.com, "ma_golyo" wrote: > > Hi! > > Cannot connect to server under heavy load. > I get "connection rejected by remote interface" (335544421). > > Is this a bug, ot there

[firebird-support] Re: Cannot connect to server under heavy load

2012-10-24 Thread ma_golyo
Sometimes I get "Unable to complete network request to host "l3s-4"" (335544721) error not 335544421. In this case nothing apperars in firebird.log. --- In firebird-support@yahoogroups.com, "ma_golyo" wrote: > > Hi! > > Cannot connect to server under heavy load. > I get "connection rejected by

[firebird-support] Re: Cannot connect to server under heavy load

2012-10-24 Thread ma_golyo
Hi! 2.0.7.13318 --- In firebird-support@yahoogroups.com, Mark Rotteveel wrote: > > On Wed, 24 Oct 2012 12:18:01 -, "ma_golyo" wrote: > > Hi! > > > > Cannot connect to server under heavy load. > > I get "connection rejected by remote interface" (335544421). > > > > Is this a bug, ot there

Re: [firebird-support] Cannot connect to server under heavy load

2012-10-24 Thread Mark Rotteveel
On Wed, 24 Oct 2012 12:18:01 -, "ma_golyo" wrote: > Hi! > > Cannot connect to server under heavy load. > I get "connection rejected by remote interface" (335544421). > > Is this a bug, ot there is an option in firebird.conft to avoid this? > > > Firebird.log (FB20 Classic Server) What is

[firebird-support] Cannot connect to server under heavy load

2012-10-24 Thread ma_golyo
Hi! Cannot connect to server under heavy load. I get "connection rejected by remote interface" (335544421). Is this a bug, ot there is an option in firebird.conft to avoid this? Firebird.log (FB20 Classic Server) L3S-4 Wed Oct 24 14:04:28 2012 I/O error for file "C:\PROGRAM FILES\FIR

Re: [firebird-support] Cannot restore a database because of failed unique key index

2012-10-24 Thread Alan McDonald
Your query needs an aggregate field. Count. Alan On Oct 24, 2012 1:49 PM, "sir_wally_lewis" wrote: > Hi, > > We use Firebird 2.5.1 on Linux 64 bit > > Firebird fails to restore because of a unique constraint( see below ). > However when interrogating the data, no duplicate is found. ( see below >