SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Select mixed row
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pawl
Starting Member

2 Posts

Posted - 09/27/2012 :  02:11:37  Show Profile  Reply with Quote
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)

Singapore
17586 Posts

Posted - 09/27/2012 :  02:58:38  Show Profile  Reply with Quote
select max(heft), max(vde), max(Prumer)  ... 
from   [base]



KH
Time is always against us

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 09/27/2012 :  10:00:20  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000