Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
table
current table detail
appMaterial appSubMaterial appSize appPcs appwts
Diamond ROUND DIAMOND 3 255 2.58
Gold GOLD 76% 2.54
Gold GOLD 92% 3.54


exactly my requirement below list how can make it query please help me sql server 2008r2
appma appsub apppu appcs appwt
gold gold 76% 255 2.55
gold gold 92% 0 3.55
Posted
Updated 8-Apr-14 0:35am
v2
Comments
Er. Puneet Goel 8-Apr-14 7:10am    
means please provide more details! the above details are confusing
antish1 8-Apr-14 7:34am    
As i have data as follow

1.gold 76% 25.25 wts
2.gold 92% 4.25 wts
3 chain 92% 10.25 wts

i want to display in sql2008
metal touch wts chain touch wts
gold 76% 25.25 chain 92% 10.25
gold 92% 4.25

touch should not be fixed
Er. Puneet Goel 8-Apr-14 7:36am    
what do you mean by 'not fixed'?
antish1 8-Apr-14 7:40am    
touch mean 92% , 76%, 86% 56% so we cant fixed the touch
we cannt fixed the touch as it is many
antish1 8-Apr-14 7:47am    
please suggest me how can build sql query

1 solution

1.
SQL
Select * from table where metal = 'Gold' OR metal = 'Chain' order by metal


This will give you only two metal group gold and chain with gold and chains together

2. for group by query please provide exact column names and data types
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900