Unfortunately I need all occurrences of the phone number because there is different information on each record (i.e. time of each call, reason for call, etc.).
Thanks for all your help.
Chris
[spin]
Marcia's query returns only the phone and the count. I need to return the entire record from tableA (name, address, phone, account number, etc.)
[spin]
Stella740pl, Mike & Marcia - Thanks I forgot you can't return more than one column in a subquery using "IN".
I have a work around but I wanted to make the following code 1 SQL statement instead of 2.
SELECT phone, count(phone) as count ;
FROM tableA ;
GROUP BY phone ;
HAVING...
Does anyone know why the following code generates an invalid subquery error in VFP 8.0?
SELECT * from tableA
WHERE phone in (SELECT phone, count(phone) as count FROM tableA GROUP BY phone HAVING count > 1)
I am trying to create a cursor of records where the phone number appears in tableA...
Craig,
>>you can create the connection string in code and use that. <<
Is there a a thread that I can see an example of a connection string in code? I will check my Hentzenwerke books for this but it might be quicker if you could point me in the right direction.
Thanks,
Chris
[spin]
I am taking my first step into the remote data world and would rather use ODBC over OLEDB and have to deal with record sets. I have to take an ascii file and insert those records into an Oracle table. Do you have to create a DSN on each computer that runs this code?
Chris
[spin]
I am taking my first step into the remote data world and would rather use ODBC. I have to take an ascii file and insert those records into an Oracle table. Do you have to create a DSN on each computer that runs this code?
Chris
[spin]
Thanks Mike!
I found a way to make it one query:
select z.county, pm.zip, count(*) ;
from zipcodes z ;
inner join pm_return pm on pm.zip == z.zip and pm.match = 'Y' ;
GROUP BY z.county, pm.zip ;
INTO TABLE pmcounts
-Chris
[spin]
Does any know if VFP can handle a Sub-Query in the FROM clause of a Query?
I get a systax error for the following query.
SELECT county, zip, count(*) ;
FROM (SELECT pm.*, z.county ;
FROM pm_return pm, zipcodes z ;
WHERE pm.zip == z.zip AND match = 'Y') ;
GROUP BY county, zip ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.