Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bspama
Starting Member
8 Posts |
Posted - 2002-11-12 : 10:54:25
|
| I tried this and am getting an error:select t.eid, sl.actionfrom (select action from events group by action having count(*) > 1) as sljoin events t on sl.action=t.eidorder by t.eidError:Server: Msg 245, Level 16, State 1, Line 1Syntax error converting the varchar value 'Define Property' to a column of data type int. |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-11-12 : 10:57:44
|
| sl.action=t.eid probably eid is integer and at least one action is 'Define Property'.As you are outputting them both I guess they shouldn't be equal.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
bspama
Starting Member
8 Posts |
Posted - 2002-11-12 : 11:01:25
|
| NR, yes eid is integer,i would like to show all documents with duplicate actions and their corresponding eid's displayed. |
 |
|
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 2002-11-12 : 11:19:07
|
| you must join like types. In this case you are joining the result from your derived table with your base table. sl.action=t.eid should be sl.action=t.action |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2002-11-12 : 11:19:10
|
quote: I tried this and am getting an error:select t.eid, sl.actionfrom (select action from events group by action having count(*) > 1) as sljoin events t on sl.action=t.eidorder by t.eidError:Server: Msg 245, Level 16, State 1, Line 1Syntax error converting the varchar value 'Define Property' to a column of data type int.
I think you needselect eid, actionfromeventswhere action in(select action from events group by action having count(*) > 1)order by t.eid |
 |
|
|
bspama
Starting Member
8 Posts |
Posted - 2002-11-12 : 11:29:16
|
Thanks for your suggestions, it worked! |
 |
|
|
|
|
|
|
|