Is it possible to obtain a count of the number of rows that would
be returned based on the following query.
select tableA.*,
tableB.fieldA,
tableB.fieldB,
tableB.fieldC,
tableC.fieldA,
tableD.fieldA,
tableD.fieldB
from tableA,
tableB,
tableC,
tableD
where
PREDICATES
group by
ALL FIELDS in the select
Thanks in advance. 4 1208
kjc (ks*****@elp.rr.com) writes: Is it possible to obtain a count of the number of rows that would be returned based on the following query.
select tableA.*, tableB.fieldA, tableB.fieldB, tableB.fieldC, tableC.fieldA, tableD.fieldA, tableD.fieldB from tableA, tableB, tableC, tableD where PREDICATES group by ALL FIELDS in the select
select COUNT(*)
from tableA,
tableB,
tableC,
tableD
where
PREDICATES
group by
ALL FIELDS in the select
If you only want read the table once you can insert into a temp table,
and check @@rowcount after the INSERT.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
Thanks for the reply Erland, but, I tried what you proposed.
What I get back is the number of rows returned by the select
all with the number 1 in each column.
Thanks again.
Erland Sommarskog wrote: kjc (ks*****@elp.rr.com) writes:
Is it possible to obtain a count of the number of rows that would be returned based on the following query.
select tableA.*, tableB.fieldA, tableB.fieldB, tableB.fieldC, tableC.fieldA, tableD.fieldA, tableD.fieldB from tableA, tableB, tableC, tableD where PREDICATES group by ALL FIELDS in the select
select COUNT(*) from tableA, tableB, tableC, tableD where PREDICATES group by ALL FIELDS in the select
If you only want read the table once you can insert into a temp table, and check @@rowcount after the INSERT.
On Fri, 10 Dec 2004 15:27:44 GMT, kjc wrote: Thanks for the reply Erland, but, I tried what you proposed. What I get back is the number of rows returned by the select all with the number 1 in each column.
Hi kjc,
Try this one instead:
SELECT COUNT(*)
FROM (
select tableA.*,
tableB.fieldA,
tableB.fieldB,
tableB.fieldC,
tableC.fieldA,
tableD.fieldA,
tableD.fieldB
from tableA,
tableB,
tableC,
tableD
where
PREDICATES
group by
ALL FIELDS in the select
) AS x
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
Thanks Hugo,
U GO !!
Hugo Kornelis wrote: On Fri, 10 Dec 2004 15:27:44 GMT, kjc wrote:
Thanks for the reply Erland, but, I tried what you proposed. What I get back is the number of rows returned by the select all with the number 1 in each column.
Hi kjc,
Try this one instead:
SELECT COUNT(*) FROM ( select tableA.*, tableB.fieldA, tableB.fieldB, tableB.fieldC, tableC.fieldA, tableD.fieldA, tableD.fieldB from tableA, tableB, tableC, tableD where PREDICATES group by ALL FIELDS in the select ) AS x
Best, Hugo This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rohit Raghuwanshi |
last post by:
Hello all,
we are running a delphi application with DB2 V8.01 which is causing
deadlocks when rows are being inserted into a table. Attaching the
Event Monitor Log (DEADLOCKS WITH DETAILS) here....
|
by: genestarwing |
last post by:
QUESTION:
Write a program that opens and read a text file and records how many
times each word occurs in the file. Use a binary search tree modified
to store both a word and the number of times it...
|
by: rllioacvuher |
last post by:
I need help with a program. I have implemented that following header file with an unordered list using one array, but i need to be able to use an ordered list and 2 arrays (one for the links and one...
|
by: J |
last post by:
I've spent most of the day on this, and I just can't seem to find a
solution, please help me! :)
I'm recieving XML that I can't modify that looks like:
<?xml version="1.0"?>
<Doc>
<Page>...
|
by: satan |
last post by:
I need a help with the program to test the insertion, deletion, search, copyList, and the copy constructor operations for an object in the class UnorderedLinkedList.
These are my classes:
...
|
by: satan |
last post by:
I need a help with the program to test the insertion, deletion, search, copyList, and the copy constructor operations for an object in the class UnorderedLinkedList.
These are my classes:
...
|
by: naknak4 |
last post by:
Introduction
This assignment requires you to develop solutions to the given problem
using several different approaches (which actually involves using three
different STL containers). You will...
|
by: naknak |
last post by:
Introduction
This assignment requires you to develop solutions to the given problem
using several different approaches (which actually involves using three
different STL containers). You will...
|
by: pic078 via AccessMonster.com |
last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files)
that remains stuck in task manager after exiting the application - you can't
reopen database after exiting as a result...
|
by: doobybug |
last post by:
Hi all,
I really need your help! I am new to java and have some problems with my code. I have a program which inputs questionnaires and creates an object for each questionnaire. These objects are...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |