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 |
|
dreamaboutnothing
Starting Member
47 Posts |
Posted - 2004-10-13 : 21:08:19
|
| Hi Guys,would you be kind enough to help me in resolving this complex select query.I have 3 tables.one non flattened but don't worry i have flattened it.Table 1 Gen_companies, column required company nameTable 2 Gen_individuals,column required individual name who advertised but not a companyTable 3 di_webclick_statistics (which i flattened)Code is like this:select substring(','+ display_name_id +',', ID,CharIndex(',',','+ display_name_id + ',', ID)-ID)As display_Name_Id from Di_Tally,di_webclick_statisticswhere display_name_id!='0'and ID <=Len(',' + display_name_id +',')and substring(',' + display_name_id +',', ID-1, 1)=','and ID<=Len(',' + display_name_id +',')AND CharIndex(',' , ',' +display_name_id + ',' , ID) - ID > 0output should look like:Advertisers |countA | 45B | 12Thank you in advance |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-10-13 : 22:29:33
|
how about some ddl and dml? --------------------keeping it simple... |
 |
|
|
|
|
|
|
|