Need Help
-
Hi, Master Table SMID(int) Descr(varchar) 43 A 47 B 208 C 502 D 549 E Child Table Descr_SMID(varchar) 208 502,549,43,47 502,549 Now I want result like this using count. A (1) B (1) C (1) D (2) E (2)
kiran banker
-
Hi, Master Table SMID(int) Descr(varchar) 43 A 47 B 208 C 502 D 549 E Child Table Descr_SMID(varchar) 208 502,549,43,47 502,549 Now I want result like this using count. A (1) B (1) C (1) D (2) E (2)
kiran banker
I don't follow the table layout, but it looks like you need something like select sum(count), letter from tbl group by letter where letter is the column that gives you A/B/C and count is the column you want to combine. use count instead of sum if you're counting columns and not combining their values
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Hi, Master Table SMID(int) Descr(varchar) 43 A 47 B 208 C 502 D 549 E Child Table Descr_SMID(varchar) 208 502,549,43,47 502,549 Now I want result like this using count. A (1) B (1) C (1) D (2) E (2)
kiran banker
banker_kiran wrote:
Child Table Descr_SMID(varchar) 208 502,549,43,47 502,549
Your child table violates one of the principles of 1st normal form. Values for each column-row intersection should be atomic. You should consider splitting these values out, otherwise it will be very difficult to query the data efficiently.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
banker_kiran wrote:
Child Table Descr_SMID(varchar) 208 502,549,43,47 502,549
Your child table violates one of the principles of 1st normal form. Values for each column-row intersection should be atomic. You should consider splitting these values out, otherwise it will be very difficult to query the data efficiently.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
pmarfleet wrote:
Your child table violates one of the principles of 1st normal form
Yes, it certainly does.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer