I have a table like this.
MES_id MES_for_col
4717 4717 = ( 4711 + 4712 + 4713)/ 3
4729 4729 = ( 4723 + 4724 + 4725 + 4726)/4
4788 4788 = ( 4780 + 4781 + 4782 + 4783 + 4784 + 4785 )/6
4795 4795 = ( 4793 + 4794 ) / 2
I need a query which will give an output like (only numbers before division sign from mes_for_col in column2 )
column1 column2
4717 4711
4717 4712
4717 4713
4729 4723
4729 4724
4729 4725
4729 4726
4788 4780...
and so on
CAn i use patindex here? Is there any query you can suggest? Thanks