sql server group
-
Hi To ALL, getting a problem when i was joined two tables and specified distinction but the rows are repeating could anyone give me the suggestion Thanks & Regards, Nath. dt_messageDate str_messge str_constituencyName 2009-01-20 00:00:00.000 Second Test Ichapuram 2009-01-20 00:00:00.000 Second Test Ichchapuram 2009-01-20 00:00:00.000 The last script Ichapuram 2009-01-20 00:00:00.000 The last script Ichchapuram 2009-01-21 00:00:00.000 Test1 Ichapuram 2009-01-21 00:00:00.000 Test1 Ichchapuram 2009-01-21 00:00:00.000 Test2 Ichapuram 2009-01-21 00:00:00.000 Test2 Ichchapuram 2009-01-23 00:00:00.000 asdf sdaaaas Ichapuram 2009-01-23 00:00:00.000 asdf sdaaaas Ichchapuram 2009-01-25 00:00:00.000 Second test Tekkali 2009-01-25 00:00:00.000 test Tekkali 2009-01-26 00:00:00.000 Godavari Anaparthy
-
Hi To ALL, getting a problem when i was joined two tables and specified distinction but the rows are repeating could anyone give me the suggestion Thanks & Regards, Nath. dt_messageDate str_messge str_constituencyName 2009-01-20 00:00:00.000 Second Test Ichapuram 2009-01-20 00:00:00.000 Second Test Ichchapuram 2009-01-20 00:00:00.000 The last script Ichapuram 2009-01-20 00:00:00.000 The last script Ichchapuram 2009-01-21 00:00:00.000 Test1 Ichapuram 2009-01-21 00:00:00.000 Test1 Ichchapuram 2009-01-21 00:00:00.000 Test2 Ichapuram 2009-01-21 00:00:00.000 Test2 Ichchapuram 2009-01-23 00:00:00.000 asdf sdaaaas Ichapuram 2009-01-23 00:00:00.000 asdf sdaaaas Ichchapuram 2009-01-25 00:00:00.000 Second test Tekkali 2009-01-25 00:00:00.000 test Tekkali 2009-01-26 00:00:00.000 Godavari Anaparthy
Based on the data on your post the rows are not repeating since always at least one column is having a different value. Distnct removes only rows where every column has the same value. Could you post a sample of the original data and info, what kind of result you're trying to get.
The need to optimize rises from a bad design.My articles[^]