|
Well, it's a complex SP, where I build a temporary table, and then I have a query with several subqueries to this temproary table. I'm at home now, so I don't have the code until tomorrow morning, and I'll be glad to post it if it helps.
What's bugging me is that only the call to the SP through the data adapter is slow, and if I run the SP directly form SQL Management Studio, it runs nicely in under 3 seconds at most.
Thanks for the reply, and I'll post the code here first thing in the morning.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
This is the code that calls the SP:
SqlCommand cmd = new SqlCommand("Reportes_RecoleccionHistoricaDiaria",
App.GetConnection(false));
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@ID_semana1", weekFrom);
cmd.Parameters.Add("@ID_semana2", weekTo);
cmd.CommandTimeout = 300;
SqlDataAdapter da = new SqlDataAdapter(cmd);
ds = new DataSet("RecoleccionHistoricaDiaria");
da.Fill(ds); and this is the stored procedure:
CREATE PROCEDURE [dbo].[Reportes_RecoleccionHistoricaDiaria]
(
@ID_semana1 int,
@ID_semana2 int
)
AS
BEGIN
DECLARE @Abonos TABLE (ID_semana int, ID_cliente int, Abono int)
INSERT INTO @Abonos
SELECT R.ID_semana, R.ID_cliente, MIN(R.ID_abono)
FROM Recibos R
WHERE R.Estatus = 1 AND R.ID_semana >= @ID_semana1 AND R.ID_semana <= @ID_semana2
GROUP BY R.ID_semana, R.ID_cliente
DECLARE @AbonosPorDia TABLE (ID_semana int, DiaPago int, Pagados int)
INSERT INTO @AbonosPorDia
SELECT OS.ID_semana, Recibos.DiaPago, COUNT(Recibos.ID_recibo) AS Pagados
FROM Operacion_Semanas OS
INNER JOIN Recibos ON OS.ID_semana = Recibos.ID_semana
INNER JOIN @Abonos A ON Recibos.ID_abono = A.Abono
WHERE OS.ID_semana >= @ID_semana1 AND OS.ID_semana <= @ID_semana2
GROUP BY OS.ID_semana, Recibos.DiaPago
ORDER BY OS.ID_semana
SELECT OS.ID_semana, OS.Fecha,
(
SELECT COUNT(ID_recibo)
FROM Recibos
WHERE Extra = 0 AND ID_semana = OS.ID_semana
) AS Emitidos,
(ISNULL(
(SELECT Pagados FROM @AbonosPorDia T
WHERE T.ID_semana = OS.ID_semana AND T.DiaPago = 4
), 0)) AS Jueves,
(ISNULL(
(SELECT Pagados FROM @AbonosPorDia T
WHERE T.ID_semana = OS.ID_semana AND T.DiaPago = 5
), 0)) AS Viernes,
(ISNULL(
(SELECT Pagados FROM @AbonosPorDia T
WHERE T.ID_semana = OS.ID_semana AND T.DiaPago = 6
), 0)) AS Sabado,
(ISNULL(
(SELECT Pagados FROM @AbonosPorDia T
WHERE T.ID_semana = OS.ID_semana AND T.DiaPago = 0
), 0)) AS Domingo,
(ISNULL(
(SELECT Pagados FROM @AbonosPorDia T
WHERE T.ID_semana = OS.ID_semana AND T.DiaPago = 1
), 0)) AS Lunes,
(ISNULL(
(SELECT Pagados FROM @AbonosPorDia T
WHERE T.ID_semana = OS.ID_semana AND T.DiaPago = 2
), 0)) AS Martes,
(ISNULL(
(SELECT Pagados FROM @AbonosPorDia T
WHERE T.ID_semana = OS.ID_semana AND T.DiaPago = 3
), 0)) AS Miercoles
FROM Operacion_Semanas OS
WHERE OS.ID_semana >= @ID_semana1 AND OS.ID_semana <= @ID_semana2
END Basically, I have a table of payments agreed by each customer in table LineasCredito_AbonosPactados which is big and currently contains about 300,000 records. Each week a customer pays one or more receipts (in table Recibos , around 70,000 records), each receipt corresponding to only one payment.
This SP gets how many customers pay each day of the week for weeks starting in @ID_semana1 and ending in @ID_semana2 (each week is a record in Operacion_Semanas ).
How it works? The first temporary table gets all the customers that paid at least one receipt, and the day they paid the first receipt, for each week in the range.
The second table counts the customers in the first table for each day of the week, so it ends up with something like this:
Week Day Count
---------------------
1 0 100
1 1 123
2 0 122
2 1 134 And finally, the recordset returned contains all the weeks in the range with one field for each different colum:
Week Total Day 0 Day 1
----------------------------
1 589 100 123 ....
2 628 122 134 .... This stored procedure works, and relatively well (2 or 3 seconds in very extreme conditions.) But only from SQL Management Studio when called with this code:
EXEC Reportes_RecoleccionHistoricaDiaria
@ID_semana1 = 1,
@ID_semana2 = 100
GO But if I use the code at the beginning of this post to call the SP from my C# application, then it always times out in the extreme condition (all 40 or so weeks) and takes about a minute for a range of 3 weeks. And then I go to SQL Server Management Studio and click on Execute and it takes less than a second... while the C# app is waiting.
Any ideas? this is driving me crazy!
Thanks!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
It suddenly started working on my SQL Server (development) as fast as exepected, but it now is slow again.
I installed the update on the production server (it's for a small business, and they have been told that this particular report will be slow for a while) and it's also very very slow. Running the SP with OSQL is also slow, but not as much as from the application.
Does anyone have any idea of what's going on? I'm going crazy!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
-- modified at 21:00 Wednesday 11th January, 2006
|
|
|
|
|
I am so crazy too when discover your problem. Could you send me the database file? (Compress and attach to email or by yousendit).
I try to create the database but I can not insert so much data.
My email address: happyrainy@gmail.com
|
|
|
|
|
Thanks, but late yesterday we found a solution. Basically we changed the code from declaring a table variable to creating a temporary table, and now it's always as "fast" as it should be:
CREATE TABLE #Abonos (ID_semana int, ID_cliente int, Abono int)
INSERT INTO #Abonos
SELECT R.ID_semana, R.ID_cliente, MIN(R.ID_abono)
FROM Recibos R
WHERE R.Estatus = 1 AND R.ID_semana >= @ID_semana1 AND R.ID_semana <= @ID_semana2
GROUP BY R.ID_semana, R.ID_cliente
CREATE TABLE #AbonosPorDia (ID_semana int, DiaPago int, Pagados int)
INSERT INTO #AbonosPorDia
SELECT OS.ID_semana, Recibos.DiaPago, COUNT(Recibos.ID_recibo) AS Pagados
FROM Operacion_Semanas OS
INNER JOIN Recibos ON OS.ID_semana = Recibos.ID_semana
INNER JOIN #Abonos A ON Recibos.ID_abono = A.Abono
WHERE OS.ID_semana >= @ID_semana1 AND OS.ID_semana <= @ID_semana2
GROUP BY OS.ID_semana, Recibos.DiaPago
ORDER BY OS.ID_semana
Thanks anyway for trying to help, I really appreciate it!
-- LuisR
nguyenvhn wrote: My email address: happy#rainy@gmail#com
P.S. I don't recommend posting your e-mail address like this. CodeProject is commonly crawled by spiders looking for e-mail addresses for spam lists. Modify your post to remove it, or at least disguise it:
happyrainy at gmail dot com
happyrainy.gmail@com (swap @ and .)
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
I cannot update the Data grid fields for the following example:
The grid and 2 buttons are visable but I cannot mainpulate (update) the data
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.cnPubs = New System.Data.SqlClient.SqlConnection
Me.daAuthors = New System.Data.SqlClient.SqlDataAdapter
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand
Me.dsPubs = New ADO.dsPubs
CType(Me.dsPubs, System.ComponentModel.ISupportInitialize).BeginInit()
'
'cnPubs
'
Me.cnPubs.ConnectionString = "workstation id=DOZER;packet size=4096;integrated security=SSPI;data source=dozer;" & _
"persist security info=False;initial catalog=pubs"
'
'daAuthors
'
Me.daAuthors.DeleteCommand = Me.SqlDeleteCommand1
Me.daAuthors.InsertCommand = Me.SqlInsertCommand1
Me.daAuthors.SelectCommand = Me.SqlSelectCommand1
Me.daAuthors.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "authors", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("au_id", "au_id"), New System.Data.Common.DataColumnMapping("au_lname", "au_lname"), New System.Data.Common.DataColumnMapping("au_fname", "au_fname")})})
Me.daAuthors.UpdateCommand = Me.SqlUpdateCommand1
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT au_id, au_lname, au_fname FROM authors"
Me.SqlSelectCommand1.Connection = Me.cnPubs
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO authors(au_id, au_lname, au_fname) VALUES (@au_id, @au_lname, @au_fna" & _
"me); SELECT au_id, au_lname, au_fname FROM authors WHERE (au_id = @au_id)"
Me.SqlInsertCommand1.Connection = Me.cnPubs
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@au_id", System.Data.SqlDbType.VarChar, 11, "au_id"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@au_lname", System.Data.SqlDbType.VarChar, 40, "au_lname"))
Me.SqlInsertCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@au_fname", System.Data.SqlDbType.VarChar, 20, "au_fname"))
'
'SqlUpdateCommand1
'
Me.SqlUpdateCommand1.CommandText = "UPDATE authors SET au_id = @au_id, au_lname = @au_lname, au_fname = @au_fname WHE" & _
"RE (au_id = @Original_au_id) AND (au_fname = @Original_au_fname) AND (au_lname =" & _
" @Original_au_lname); SELECT au_id, au_lname, au_fname FROM authors WHERE (au_id" & _
" = @au_id)"
Me.SqlUpdateCommand1.Connection = Me.cnPubs
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@au_id", System.Data.SqlDbType.VarChar, 11, "au_id"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@au_lname", System.Data.SqlDbType.VarChar, 40, "au_lname"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@au_fname", System.Data.SqlDbType.VarChar, 20, "au_fname"))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_au_id", System.Data.SqlDbType.VarChar, 11, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "au_id", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_au_fname", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "au_fname", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_au_lname", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "au_lname", System.Data.DataRowVersion.Original, Nothing))
'
'SqlDeleteCommand1
'
Me.SqlDeleteCommand1.CommandText = "DELETE FROM authors WHERE (au_id = @Original_au_id) AND (au_fname = @Original_au_" & _
"fname) AND (au_lname = @Original_au_lname)"
Me.SqlDeleteCommand1.Connection = Me.cnPubs
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_au_id", System.Data.SqlDbType.VarChar, 11, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "au_id", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_au_fname", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "au_fname", System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@Original_au_lname", System.Data.SqlDbType.VarChar, 40, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "au_lname", System.Data.DataRowVersion.Original, Nothing))
'
'dsPubs
'
Me.dsPubs.DataSetName = "dsPubs"
Me.dsPubs.Locale = New System.Globalization.CultureInfo("en-US")
CType(Me.dsPubs, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
Protected WithEvents cnPubs As System.Data.SqlClient.SqlConnection
Protected WithEvents daAuthors As System.Data.SqlClient.SqlDataAdapter
Protected WithEvents SqlSelectCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlInsertCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlUpdateCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents SqlDeleteCommand1 As System.Data.SqlClient.SqlCommand
Protected WithEvents dsPubs As ADO.dsPubs
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
Protected WithEvents btnRefresh As System.Web.UI.WebControls.Button
Protected WithEvents btnSave As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
dsPubs.Clear()
daAuthors.Fill(dsPubs)
DataGrid1.DataBind()
End Sub
Private Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
daAuthors.Fill(dsPubs.authors)
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
daAuthors.Update(dsPubs.authors)
End Sub
End Class
|
|
|
|
|
Hello all,
I want to get access to some databases which are registered in Windows with ODBC.
I already managed to get the registered database names, files, servers... everything.
What I am now missing is how I could get the table names of those databases??
I can open an OdbcConnection to any of those databases, but I cannot read anything out of them because I dont know the table names which are in those databases.
So, how can I programmatically get the table names of a database where I already have an OdbcConnection successfully established and open?
Thanks for any help.
Best regards,
Bertram Weckmann
|
|
|
|
|
Hi I am having a bit of trouble trying to display my times in 24hr format, at the moment it is displaying the times with am and pm im just wondering if anyone has any ideas of how to do this
Tim
select ID, SUBSTRING(CAST(Date as nVarChar), 13,20) as Date from Session where (SquadId = 5) and CONVERT(smalldatetime, CONVERT(varchar(8), Date, 112)) = '01/10/2006'
|
|
|
|
|
Use CONVERT[^] to convert the date into just a time. For example: CONVERT(varchar(5), Date, 108)
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
yes indeed thats exactly what i needed thanks alot man i appreciate it
|
|
|
|
|
hi all,
this is my query.
I have 3tables(a,b,c).
i am connecting table a with table b using columns
pinnumber(in a table) with Usernumber(in table b).
if this query is correct then only i have to compare
third table column (menuid)with second table column(accessid)
pls help me out of this problem.
Regards
sharmi
rs_net
|
|
|
|
|
Your description isn't very easy to understand. What are the primary keys of each table? What are their foreign key counterparts in other tables?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
When I run the setup.exe in Windows 2000 sp4, there is a dialog which said 'Could not find the main class.Program will exit.'
Then caption of the dialog is 'Java Virtural Machine Laucher'.
Then the program exit.
I tried many computer, some of them is good , and some of them like this.
The OS is Windows 2000 sp4, database is Oracle9i, .net framework is 2.0 beta 2.
Why?
Thanks!
|
|
|
|
|
Hi,
I'm hoping someone can help me with this (hopefully very simple) problem I am experiencing as a newbie to SQL Server and ASP.NET. I have created a database in SQL Server 2000, and am attempting to show the records from one of the tables in a Visual C# program using Visual Studio.NET 2002.
I am following an online tutorial and have successfully added an SqlConnection in Visual Studio, and can see all relevant tables and columns in my Server Explorer. When I then try to add a SqlDataAdapter to my form, the wizard takes me through the configuration step by step. The final step is to build a query which I have completed successfully (a simple SELECT which I have tested previously using Query Analyser), until I click 'Next' and get the following error message:
Generated SELECT Statement.
Exception from HRESULT: 0x800700C1.
I'm sure there is something simple that I am doing wrong here, as it seems such a straightforward thing to do. Any advice would be much appreciated!
Many Thanks!
|
|
|
|
|
Hai
My system is already installed with SQL server 2000 . Is it possible for me to install SQL server 2005 BETA CTP in the same machine and run both side by side.
Regards
|
|
|
|
|
Yes, but I wouldn't recommend using the beta any more. The beta period is over why don't you use the final version?
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Thanks for ur reply.
i installed 2005. The Server Mangaement Studio still connect to version 8.0. SQL server express instance is not running . how can i manually run the instance or please suggest any other alernative.
In 2000 we had service manager, is anything similar in 2005
Regards
|
|
|
|
|
anig1234 wrote: how can i manually run the instance
Use the SQL Server Configuation manager.
anig1234 wrote: In 2000 we had service manager, is anything similar in 2005
The SQL Server Configuration manager is similar, but much expanded as you can do a lot more than jist start and stop services.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Thanks For the reply.
Woruld you please tell me the steps to follow and make Server management studio use SQL server version 9.0
Is there any way to Switch between version 8.0 and 9.0 in SMS.
Regards
|
|
|
|
|
anig1234 wrote: Woruld you please tell me the steps to follow and make Server management studio use SQL server version 9.0
It is installed with SQL Server 2005 (version 9.0 as you put it) and will automatically pick up on any SQL Servers on the local machine - At least mine did - you should not have to do any additional work.
anig1234 wrote: Is there any way to Switch between version 8.0 and 9.0 in SMS.
You can have multiple SQL Servers running on a physical machine simultaneously. There is no need to "switch" between them.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hallo,
Most of the utilities won't work with the beta. At least I never got them running on my server. The latest version is ok. No problem with the server management studio.
I run sql server 2000 (msde) and sql server 2005 (express) since half a year already side by side. My only problem was. I could only use osql. Everything else was not working.
Now I again installed side by side on another server using the latest express version. Everything is working with little problems.
Sincerely
Chris
|
|
|
|
|
I have a small query regarding SQL server 2000. I want to create a database whose mdf and ldf files will reside on a different computer. Now this computer is a Linux Server. My criteria is that, the mdf and ldf files will reside on a Linux server and I should be able to access those files from the SQL server installed on my system. Is this possible? If so, how do I go about doing it?
Thanks...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Save My Soul - (SMS) wrote: My criteria is that, the mdf and ldf files will reside on a Linux server and I should be able to access those files from the SQL server installed on my system. Is this possible?
No. The files used by SQL Server must reside on the same physical machine that the SQL Server service is running on.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hi, everyone. Need help here. Let's straight to question:
I have 2 tables:
tb1 -- productID, productDescription
tb2 -- productID, itemID, itemDescription......blabla
In my tb1:
productID | productDescription
-------------------------------
HAD | Hardware
TOY | Toy
CAR | Car
STA | Stationary
and in my tb 2:
productID | itemID | itemDescription ......blabla
-------------------------------------------------
HAD | mou1 | mouse1
HAD | mou2 | mouse2
HAD | mou3 | mouse3
...
..
TOY | scar1 | small car1
TOY | scar2 | small car2
...
..
.
Assume that
there got 7 items under TOY, 18 under HAD, 18 under CAR,
and ___No Item Under STA___ <--- I have problem with this. keep reading.
--------------------------------------------------------------
i'm using MSSQL,
this is the sql command i worked so far:
select tb1.productID, count (tb2.itemID) as CountedProducts
from tb1, tb2 where
tb1.productID=tb2.productID
group by tb1.productID
/*result*/
TOY 7
HAD 18
CAR 18
/********************/
but the expected result i want is suppose to be like this
STA 0
TOY 7
HAD 18
CAR 18
anyone please help. thx.
|
|
|
|
|
You have used INNER JOIN query. Please use LEFT OUTER JOIN
|
|
|
|
|