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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select mixed row

Author  Topic 

pawl
Starting Member

2 Posts

Posted - 2012-09-27 : 02:11:37
Hi,

It is possible to mixed selected row? I have tables – (it is product recepture for assembly device).

Def

CREATE TABLE [base] (
[heft] INT,
[vde] BOOL,
[Prumer] FLOAT,
[Delka] FLOAT,
[M1P1] FLOAT,
[M1P2] FLOAT,
[M1P3] FLOAT,
[M2P1] FLOAT,
[M2P2] FLOAT);

DATA:

RecNo heft vde Prumer Delka M1P1 M1P2 M1P3 M2P1 M2P2
----- ------ ------ ------ ------ ------ ------ ------ ------ ------
1 (null) (null) (null) (null) (null) 100 50 (null) (null)
2 81 False (null) (null) 12.1 (null) 45.1 14.1 12
3 81 (null) 3 (null) 13 (null) (null) 16.2 12.4


„Heft“ is main name of variant. RecNo 1 is general options it possible to set default vaule for all product. (heft is NULL)
„Prumer“ and „Delka“ is can determine specification of product.
Rec No. Is representation of variant „81“ it is default value. „Prumer“ and „Delka“ is NULL.
How to SELECT row 4 and mixed with row 1,2 ( replace parameter null M1P1, M1P2 … descending ). Now I do this on side of application.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-09-27 : 02:58:38
[code]select max(heft), max(vde), max(Prumer) ...
from [base][/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-09-27 : 10:00:20
sorry cant understand what meaning does this output make. I feel like you should have a column based on which grouping has to happen

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -