Click here to Skip to main content
15,895,709 members
Home / Discussions / Database
   

Database

 
QuestionProblem in Using ADO in C++ to Get Oracle Ref Cursor Data Pin
Kelvin X Li20-Feb-07 11:02
Kelvin X Li20-Feb-07 11:02 
QuestionCount Problem Pin
ronivars20-Feb-07 9:14
ronivars20-Feb-07 9:14 
AnswerRe: Count Problem Pin
Mark J. Miller20-Feb-07 9:33
Mark J. Miller20-Feb-07 9:33 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 10:15
ronivars20-Feb-07 10:15 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 10:24
ronivars20-Feb-07 10:24 
GeneralRe: Count Problem Pin
Mark J. Miller20-Feb-07 11:52
Mark J. Miller20-Feb-07 11:52 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 12:16
ronivars20-Feb-07 12:16 
GeneralRe: Count Problem Pin
Mark J. Miller20-Feb-07 12:23
Mark J. Miller20-Feb-07 12:23 
I'm running 2005 also. This script:

IF OBJECT_ID('Table1') IS NOT NULL
DROP TABLE Table1
IF OBJECT_ID('Table2') IS NOT NULL
DROP TABLE Table2
go

CREATE TABLE Table1(Col1 Varchar(15))
CREATE TABLE Table2(Col2 VARCHAR(100))


INSERT INTO Table1 VALUES('1000')
INSERT INTO Table1 VALUES('1001')
INSERT INTO Table1 VALUES('1002')


INSERT INTO Table2 VALUES('A1000A')
INSERT INTO Table2 VALUES('bbb1000bcd')
INSERT INTO Table2 VALUES('cdf1000frg')
INSERT INTO Table2 VALUES('A1001a')
INSERT INTO Table2 VALUES('bvc1001dcfe')


SELECT T1.Col1, COUNT(*) FROM Table1 T1
INNER JOIN Table2 T2 ON T2.Col2 LIKE '%' + T1.Col1 + '%'
GROUP BY T1.Col1


Gives me these results:

1000 3
1001 2


If this isn't working for you, you'll need to give me your schema and what the results are (or the error messages).
GeneralRe: Count Problem Pin
ronivars20-Feb-07 12:50
ronivars20-Feb-07 12:50 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 13:21
ronivars20-Feb-07 13:21 
GeneralRe: Count Problem Pin
ronivars20-Feb-07 12:22
ronivars20-Feb-07 12:22 
QuestionCount Query Prob Pin
tadhg8820-Feb-07 6:39
tadhg8820-Feb-07 6:39 
AnswerRe: Count Query Prob Pin
andyharman20-Feb-07 7:05
professionalandyharman20-Feb-07 7:05 
AnswerRe: Count Query Prob Pin
tadhg8820-Feb-07 7:32
tadhg8820-Feb-07 7:32 
GeneralRe: Count Query Prob Pin
andyharman20-Feb-07 8:17
professionalandyharman20-Feb-07 8:17 
GeneralRe: Count Query Prob Pin
tadhg8821-Feb-07 0:37
tadhg8821-Feb-07 0:37 
GeneralRe: Count Query Prob Pin
tadhg8822-Feb-07 1:53
tadhg8822-Feb-07 1:53 
QuestionHow to add costum row to combo what linked to DataSource Pin
El'Cachubrey20-Feb-07 3:37
El'Cachubrey20-Feb-07 3:37 
QuestionHow to order Integer field as a string ?? Pin
kindman_nb20-Feb-07 3:22
kindman_nb20-Feb-07 3:22 
AnswerRe: How to order Integer field as a string ?? Pin
Aswanikumarj20-Feb-07 3:45
Aswanikumarj20-Feb-07 3:45 
GeneralRe: How to order Integer field as a string ?? Pin
kindman_nb20-Feb-07 5:05
kindman_nb20-Feb-07 5:05 
AnswerRe: How to order Integer field as a string ?? Pin
andyharman20-Feb-07 3:46
professionalandyharman20-Feb-07 3:46 
GeneralRe: How to order Integer field as a string ?? Pin
kindman_nb20-Feb-07 5:07
kindman_nb20-Feb-07 5:07 
QuestionSQL server does not exists or access denied. Pin
Aswanikumarj20-Feb-07 3:06
Aswanikumarj20-Feb-07 3:06 
AnswerRe: SQL server does not exists or access denied. Pin
Krish - KP20-Feb-07 17:11
Krish - KP20-Feb-07 17:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.