Get resultset in one row

This one is really freaking me out.
I'm trying to "shirk" a dataset before its returned to a dwo.

My select is a union:

SELECT    account,
                    sum(USD) as period 1,
                    0.00 as period_2,
FROM......
WHERE pdate between '1998-01-01' and '1998-01-31'
UNION ALL
SELECT     account,
                    0.00 as period 1,
                    sum(USD) as period_2,
FROM......
WHERE pdate between '1998-02-01' and '1998-02-28'

This gives me result in the dw:

ACCOUNT        PERIOD_1    PERIOD_2

1010                    1000,-                        0
1010                            0                  2500.-
1020                       750,-                       0
1020                            0                     340.-
etc,etc.

What I want returned to the dw is this:

1010                    1000,-                        2500,-
1020                       750,-                        340,-
etc,etc

I've got 12 periods.
The net trafic: row * 12 = no god

Any ideas??

NB
I can't use a

Select sum(USD) as period_1
(select sum(USD) from ...
where pdate between '1998-02-01' and '1998-02-28' ) as period_2
FROM..
WHERE..

because this kind of transaction table usually has 40-80 000 rows, and this
one gets to slow....







0
Brage
2/3/1999 1:34:26 PM
sybase.powerbuilder.general 62418 articles. 18 followers. Follow

4 Replies
314 Views

Similar Articles

[PageSpeed] 33

Union makes more rows in the result set.  That is what they do.

Obviously there is more to you query (you used elipses "...").  So, maybe
you didn't type in all the where clause.  But, the reason that

>Select sum(USD) as period_1
>(select sum(USD) from ...
>where pdate between '1998-02-01' and '1998-02-28' ) as period_2
>FROM..
>WHERE..

is slow is that you are calculating the period_2 total without limiting it
to a particular account which will scan the entire table with pdate, USD for
each row in the result set.

Also you'll have fun doing the date logic.

Try the following...

select
    account,
    sum(if Month(pdate)=1 then USD else 0) as period_1,
    sum(if Month(pdate)=2 then USD else 0) as period_2,
    ...
from
    ...
where
    pdate between '1998-01-01' and '1998-12-31'
group by
    account

Brage Mogstad wrote in message ...
>This one is really freaking me out.
>I'm trying to "shirk" a dataset before its returned to a dwo.
>
>My select is a union:
>
>SELECT    account,
>                    sum(USD) as period 1,
>                    0.00 as period_2,
>FROM......
>WHERE pdate between '1998-01-01' and '1998-01-31'
>UNION ALL
>SELECT     account,
>                    0.00 as period 1,
>                    sum(USD) as period_2,
>FROM......
>WHERE pdate between '1998-02-01' and '1998-02-28'
>
>This gives me result in the dw:
>
>ACCOUNT        PERIOD_1    PERIOD_2
>
>1010                    1000,-                        0
>1010                            0                  2500.-
>1020                       750,-                       0
>1020                            0                     340.-
>etc,etc.
>
>What I want returned to the dw is this:
>
>1010                    1000,-                        2500,-
>1020                       750,-                        340,-
>etc,etc
>
>I've got 12 periods.
>The net trafic: row * 12 = no god
>
>Any ideas??
>
>NB
>I can't use a
>
>Select sum(USD) as period_1
>(select sum(USD) from ...
>where pdate between '1998-02-01' and '1998-02-28' ) as period_2
>FROM..
>WHERE..
>
>because this kind of transaction table usually has 40-80 000 rows, and this
>one gets to slow....
>
>
>
>
>
>
>


0
Sam
2/3/1999 3:00:36 PM
Try using a characteristic function for this.  Details below (sorry for
any poor formatting).

HTH,

steve
[TeamPS]

Brage Mogstad wrote:
> 
> This one is really freaking me out.
> I'm trying to "shirk" a dataset before its returned to a dwo.
> 
> My select is a union:
> 
> SELECT    account,
>                     sum(USD) as period 1,
>                     0.00 as period_2,
> FROM......
> WHERE pdate between '1998-01-01' and '1998-01-31'
> UNION ALL
> SELECT     account,
>                     0.00 as period 1,
>                     sum(USD) as period_2,
> FROM......
> WHERE pdate between '1998-02-01' and '1998-02-28'
> 
> This gives me result in the dw:
> 
> ACCOUNT        PERIOD_1    PERIOD_2
> 
> 1010                    1000,-                        0
> 1010                            0                  2500.-
> 1020                       750,-                       0
> 1020                            0                     340.-
> etc,etc.
> 
> What I want returned to the dw is this:
> 
> 1010                    1000,-                        2500,-
> 1020                       750,-                        340,-
> etc,etc
> 
> I've got 12 periods.
> The net trafic: row * 12 = no god
> 
> Any ideas??
> 
> NB
> I can't use a
> 
> Select sum(USD) as period_1
> (select sum(USD) from ...
> where pdate between '1998-02-01' and '1998-02-28' ) as period_2
> FROM..
> WHERE..
> 
> because this kind of transaction table usually has 40-80 000 rows, and this
> one gets to slow....


Single-Statement SQL Statements for fast conditional data retrieval 

Characteristic functions can be used to implement single-statement SQL
statements with conditional logic in the columns retrieved. Other
solutions to problems where characteristic
functions can typically be used are generally inefficient and difficult
to implement as a single SQL statement.

A characteristic function is one which returns one or zero (and
optionally NULL). It can be used in part of a computed expression in an
SQL SELECT statement to conditionally return one
value or another. 

Examples of useful characteristic functions are given (using Transact
SQL), along with case studies. 

A 'Classic' Example 

Suppose you have sales data held in the following table: 

 Product 
              Month
                         Revenue 
 "Widget"
              1 
                         5500
 "Widget"
              2 
                         7440
 �
               
                          
 "Gadget"
              1 
                         8900
 "Gadget"
              2 
                         7700
 �
               
                          
 "Gadget"
              12 
                         10345


The view your users want to see however is a report of the form: 

 Product
                Jan 
                               Feb
                                              � 
                                                              Dec
 "Widget" 
                5500 
                               7440
                                              � 
                                                               
 "Gadget" 
                8900 
                               7700
                                              � 
                                                              10345


This type of transformation of data is called pivoting. 

First go 

A conventional approach to this problem might be to build a report
table, and update the individual monthly totals in separate updates (see
exhibit A)

     INSERT INTO report
     SELECT product, 
     jan_rev = revenue, 
     feb_rev = 0,
     �
     dec_rev = 0
     FROM sales
     WHERE month = 1

     UPDATE report
     SET feb_rev = revenue
     FROM sales
     WHERE month = 2

     �

     UPDATE report
     SET dec_rev = revenue
     FROM sales
     WHERE month = 12

This is not ideal on three counts: 

   1.This is certainly not a single SQL statement 
   2.The sales table is likely to be scanned sequentially twelve times 
   3.In order to ensure recovery and concurrency, transaction management
would need to be included 

Second go 

Another approach might be to implement a twelve-way join on the sales
table (see exhibit B).

     SELECT s1.product,
     jan_rev = s1.revenue,
     feb_rev = s2.revenue,
     �
     dec_rev = s12.revenue
     FROM sales s1, sales s2,�, sales s12
     WHERE s1.product = s2.product
     AND s2.product = s3.product
     �
     AND s11.product = s12.product
     AND s1.month = 1
     AND s2.month = 2
     �
     AND s12.month = 12

This is a single SQL statement, and hence concurrency is handled by the
DBMS. Unfortunately, as might be expected, this statement is not at all
efficient. 

Third go 

What is required is a method of returning one row for each product, and
conditionally calculating the monthly totals as we go. This can be
achieved by using characteristic functions. 

Concentrating on the February revenue, we want to catch the revenue
figure for month = 2. Before illustrating the characteristic function
used to achieve this, we need some notation. 

Define a characteristic function d[expression] as a function which
returns 1 if the expression is true, 0 if the expression is false (and
NULL if the expression is NULL). Hence in our
example, we want d[month=2] or more generally d[A=B]. This can be
achieved as follows:

     d[A=B]   = 1-abs(sign(A-B))

In our example this is written:

     1-abs(sign(month-2))

Most characteristic functions working on numeric columns use the
built-in functions abs and sign. Sign(x) returns 1 if x is positive, -1
if x is negative and 0 if x is zero. Abs(x) returns the
absolute value of x. The above expression is evaluated as shown in the
following table: 

 month	month-2	sign(month-2)	abs(sign(month-2))	1-abs(sign(month-2))
 1	 -1	 -1		1			0
 2	0	0		0			1
 3	1	1		1			0
.....
12	10	1		1			0


If this expression is then multiplied by the actual revenue figure, then
we have almost solved the problem. All that is needed now is to add a
GROUP BY clause, to ensure that only one
row is retrieved for each product.

     SELECT product,
     jan_rev = sum(revenue*(1-abs(sign(month-1)))),
     feb_rev = sum(revenue*(1-abs(sign(month-2)))),
     �
     dec_rev = sum(revenue*(1-abs(sign(month-12))))
     FROM sales
     GROUP BY product

Observe, this is a single SQL statement, hence concurrency is controlled
by the DBMS. It also only requires one table scan to produce the
results. 

Other Characteristic Functions 

Below is a list of characteristic expressions for commonly required
expressions for the d[] functions. 

Numeric values

     d[A=B] = 1-abs(sign(A-B))
     d[A!=B] = abs(sign(A-B)) {NB = 1-d[A=B]}
     d[A<B] = 1-sign(1+sign(A-B))
     d[A<=B] = sign(1-sign(A-B))
     d[A>B] = 1-abs(1-sign(A-B))
     d[A>=B] = sign(1+sign(A-B))
     d[A is NULL] = isnull(0*A,1)
     d[A is NOT NULL] = 1-isnull(0*A,1)
     d[NOT A] = 1-d[A]
     d[A AND B] = d[A]*d[B] {NB where d[A] and d[B] are never NULL}
     d[A OR B] = sign(d[A]+d[B]) {NB where d[A] and d[B] are never NULL}

String values

     d[A=B] = charindex(A,B)*charindex(B,A)
     d[A!=B] = 1-charindex(A,B)*charindex(B,A)
     d[A is NULL] = isnull(0*ascii(A),1)
     d[A is NOT NULL] = 1-isnull(0* ascii(A),1)

Date values

     d[A=B] = 1-abs(sign(datediff(dd,B,A))
     d[A!=B] = abs(sign(datediff(dd,B,A))
     d[A<B] = 1-sign(1+sign(datediff(dd,B,A)))
     d[A<=B] = sign(1-sign(datediff(dd,B,A)))
     d[A>B] = 1-abs(1-sign(datediff(dd,B,A)))
     d[A>=B] = sign(1+sign(datediff(dd,B,A)))
     d[A is NULL] = isnull(0*datepart(yy,A),1)
     d[A is NOT NULL] = 1-isnull(0* datepart(yy,A),1)

A Case Study 

Deal information was held in the following format: 

 id 
              Description
                         Rejectdate 
 1
              Deal A 
                         2-Jan-1996
 � 
               
                          
 783
              Deal MMH 
                         5-Jan-1996
 784
              Deal IHJ 
                         8-Jan-1996


The requirement was, given a particular day, display all rejected deals
in terms of the number of working days that have elapsed since that deal
was rejected. Group all deals which have
been rejected for more than 5 days together. Hence the resulting report
for 9-Jan-1996 should look something like this (NB we assume here that
"6 days rejected" can easily be interpreted
as "more than 5 days�"): 

 Deal
           Name
                        Days Rejected
 1
           Deal A
                        5 
 783
           Deal MMH
                        2 
 784
           Deal IHJ
                        1 


There are four steps to solving this problem. 

Step 1 

Calculate the number of days rejected (Store in rj) 

           rj
             =
                                                             
datediff(dw,GetDate(),rejectdate)


Step 2 

For over 1 week old (8 days or more), return 8, else return rj (Store in
rj2)

      rj2
                     =
                                  rj*d[8>=rj]-8*d[rj>8]
  
                     =
                                 
rj*sign(1+sign(8-rj))-8*(1-sign(1-sign(rj-8)))


Step 3 

Calculate the day of the week now (Store in wk)

     wk = datepart (dw, GetDate())

Step 4 

For rj2> wk, subtract 2 (to remove the weekend) else return rj2 (Store
in rj3)

       rj3
                          =
                                           rj2 + 2*d[rj2>=wk]
  
                          =
                                           rj2 + 2*sign(1+sign(rj2-wk))


The Final Expression 

The final expression is shown below, and can be built up by replacing
the variable declarations above with their corresponding expression from
a previous step. 

     d[datediff (dw, getdate(), rejectdate)]*sign(1+sign(8-
      d[datediff (dw, getdate(), rejectdate)]))-8*(1-sign(1-sign
     (d[datediff (dw, getdate(), rejectdate)]-8))) + 2*sign(1+sign
     (d[datediff (dw, getdate(), rejectdate)]*sign(1+sign(8-
      d[datediff (dw, getdate(), rejectdate)]))-8*(1-sign(1-sign
     (d[datediff (dw, getdate(), rejectdate)]-8)))
      - datepart (dw, GetDate())))

NULL Values - a warning! 

The expression for d[A=B] above where a data value is missing would
return a zero. It would perhaps make more sense in such cases for the
function to return NULL. One way to achieve
this is to use a feature of Sybase (pre System 10) whereby 1/0 is NULL.
In addition if d[A] or d[B] can take NULL values, then the expressions
d[A AND B] and d[A OR B] need some
modification. Hence the characteristic functions become:

     d[A=B] = 1/(1-abs(sign(A-B)))
     d[A AND B] = isnull(d[A]*d[B],0/(1-isnull(d[A],1)* isnull(d[B],1)))
     d[A OR B] = isnull(sign(d[A]+d[B]),1/(isnull(d[A],0) +
isnull(d[B],0)))

In Sybase system 10 and above, 1/0 generates an error, and the syntax
becomes even more daunting!

     d[A=B] = 1 +
ascii(char(convert(int,abs(sign(1-abs(sign(A-B)))))-1))
     d[A AND B] = isnull(d[A]*d[B], ascii(char(convert(int,abs(sign(
1-isnull(d[A],1)* isnull(d[B],1))))-1)))
     d[A OR B]  = isnull(sign(d[A]+d[B]),
ascii(char(convert(int,abs(sign( isnull(d[A],0) + isnull(d[B],0))))-1)))

Generally, if one were assuming (pre System 10) that 0/n would return
NULL, this would need to be replaced with the expression:

     ascii(char(convert(int,abs(sign(n)))-1))
0
Steve
2/3/1999 3:16:26 PM
Dear Sir's!

Thank you for taking the time to guide me in this matter!

I did use a group by, and had a where clause adjusted to an index.
My example could have been better, but you both got my problem right.
For the accumulation of periods I was out of ideas, because the user could
have
defined periods that didn't follow the month.

But Sam, I have to say, you really saved my day!!

The select now goes like this:

SELECT distinct "rw800reskontrotrans"."account_nmbr" ,
             "rw002customer"."name" ,
             sum((if pdato between '1998-01-01' and '1998-01-31' then nokbel
ENDIF)) as period_1,
             sum((if pdato between '1997-01-12' and '1997-12-31' then nokbel
ENDIF)) as period_2, // etc..
FROM  "rw800reskontrotrans",
             "rw002customer"
WHERE ( "rw800reskontrotrans"."client_nmbr" = "rw002kunde"."client_nmbr" )
and
                ("rw800reskontrotrans"."account_nmbr" =
"rw002kunde"."customer_nmbr") and
                ( ( "rw800reskontrotrans"."client_nmbr" = 112 ) and
                ( "rw800reskontrotrans"."account_nmbr" between 10000 and
59999 ))
GROUP BY "rw800reskontrotrans"."account_nmbr", "rw002customer"."name"
ORDER BY 1 ASC

It fires like a dream, and boy am I glad to see this work!!


B

PS:
I tried to experiment a bit on an approach given to me by Steve, but they
all gave me an error.

first attempt:
sum(USD * (1 - abs(sign(datediff(28, '1998-01-28', pdate))))) as period_1,

second attempt:
sum(USD * (1 - abs(sign(datediff(28, '1998-01-01', pdate))))) as period_1,

and some more

Any suggestions on what goes wrong here??







0
Brage
2/3/1999 9:10:09 PM
You specified the datediff parms incorrectly (at least as far as Sybase
SQL Server and ASE are concerned).  Datediff is typed as:

datediff (datepart, date, date) where datepart is one of the following:
year		yy	1753-9999 
quarter		qq	1-4 
month		mm	1-12 
week		wk	1-54 
day		dd	1-31 
dayofyear	dy	1-366 
weekday		dw	1- 7 (Sunday-Saturday) 
hour		hh	0-23 
minute		mi	0-59 
second		ss	0-59 
millisecond	ms	0-999 

So, if you were trying to see if the date was a particular day you would
use:

sum(USD * (1 - abs(sign(datediff(dd, '1999-02-03', pdate)))))

For a date range, it becomes a bit trickier and I haven't figured it out
yet and don't plan to unless you pay me <vbg>.

Regards,

steve
[TeamPS]


Brage Mogstad wrote:
> 
> Dear Sir's!
> 
> Thank you for taking the time to guide me in this matter!
> 
> I did use a group by, and had a where clause adjusted to an index.
> My example could have been better, but you both got my problem right.
> For the accumulation of periods I was out of ideas, because the user could
> have
> defined periods that didn't follow the month.
> 
> But Sam, I have to say, you really saved my day!!
> 
> The select now goes like this:
> 
> SELECT distinct "rw800reskontrotrans"."account_nmbr" ,
>              "rw002customer"."name" ,
>              sum((if pdato between '1998-01-01' and '1998-01-31' then nokbel
> ENDIF)) as period_1,
>              sum((if pdato between '1997-01-12' and '1997-12-31' then nokbel
> ENDIF)) as period_2, // etc..
> FROM  "rw800reskontrotrans",
>              "rw002customer"
> WHERE ( "rw800reskontrotrans"."client_nmbr" = "rw002kunde"."client_nmbr" )
> and
>                 ("rw800reskontrotrans"."account_nmbr" =
> "rw002kunde"."customer_nmbr") and
>                 ( ( "rw800reskontrotrans"."client_nmbr" = 112 ) and
>                 ( "rw800reskontrotrans"."account_nmbr" between 10000 and
> 59999 ))
> GROUP BY "rw800reskontrotrans"."account_nmbr", "rw002customer"."name"
> ORDER BY 1 ASC
> 
> It fires like a dream, and boy am I glad to see this work!!
> 
> B
> 
> PS:
> I tried to experiment a bit on an approach given to me by Steve, but they
> all gave me an error.
> 
> first attempt:
> sum(USD * (1 - abs(sign(datediff(28, '1998-01-28', pdate))))) as period_1,
> 
> second attempt:
> sum(USD * (1 - abs(sign(datediff(28, '1998-01-01', pdate))))) as period_1,
> 
> and some more
> 
> Any suggestions on what goes wrong here??
0
Steve
2/4/1999 4:23:45 PM
Reply:

Similar Artilces:

How do i get one row if the resultset returned has no rows.
Hi I have couple of CTE's which i want to ultimately insert into a temp table... and based on my condition some of the CTE's return some rows and some dont... but i want to have the CTE return atleast one row if there is no data in it.. I have tried doing the following but i am not getting the desired output    ;with cte_rpt4 as (select '4' a,recd_dt as approve_dt, prov_no, prov_name, client_id, claim_mst_id, claim_adj_id, claim_dt, claim_amt, rpt4, (Select count(distinct(Claim_mst_Id)) as crpt4 from #temp1 where datediff(day,isnull(recd_dt,create_dt),isnull(c...

FormView Paging Challenge: Get multiple rows out of one row using parsing.
I have a database which returns Articles, one row per Article. Each article has multiple fields, ID, Title, Subtitle, Summary, Text etc.I return the row from an ObjectDataSource which uses a stored procedure on a SQL Box.Inside the "TEXT" field, there is text -  [NEWPAGE] wherever a new page should start. eg. Content Content This is Content This is Content This is Content This is Content This is Content Content Content Content Content Content [NEWPAGE]This is Content  This is Content This is Content This is Content This is Content This is Content [NEWPAGE]This is Content&...

getting resultset in powerbuilder
Hi, I've an EJB component on my jaguar that has a method that returns an resultset. I've created the proxies in PB and I can call all the methods on the EJB. One method returns a ResultSet (TabularResults.ResultSet), I get the resultset in my pb application. Next, I create a datastore followed by a CreateFrom based on the returned resultset. So far, so good. But when I do a rowcount on the datastore it returns 0, meaning there were no rows. Although I'm sure there is 1 row in the resultset. Has anyone an idea what is going wrong? San. Hi Carson, Indea...

Calculated value of a field in the row is getting displayed in the next row instead of the same one
I have a Gridview in which I am pulling data from an access database. One of the columns in the gridview pulls a field named Last Login Date. I want to calculate the difference between the Last Login Date and the Current Date and display the calculated difference in an additional column in the same row. I have verified that the calculation is happening just fine. But when the page is displayed, the calculated value is getting displayed in the next row instead of the same row. The value of Difference in the first row is showing as 0 (zero). Calculated Values ...

How to read a dataset one row by one row?
I know you can use DataSet after close sql connection. I want to something after getting dataset, read from one row by one row, just like while datareader.read() Can I read dataset just like this? Thanks in advance! Justin Is this what you're looking for (from the Tips and Tricks Section of ASPNet101.com):http://aspnet101.com/aspnet101/tips.aspx?id=175David WierMCP/ASPInsiderASPNet101.com - where to look first!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as Answer&...

How to get selected rows in Powerbuilder
Greetings All, Using PB 9.0.3. I have a window that has 1 datawindow on it. This datawindow is being populated with data to serve as a "email" type system. I need the user to be able to highlight rows and then delete all rows they chose. So far I have been unsuccessful trying to get information on the selected rows. I am currently using: dw_1.Object.Data.Selected to try to get the information, but am getting the following error: Error: Non-array expected in ANY variable at line 2 in clicked event of object cb_1 of w_inboxdel. string setting setting = dw_1.Object.Da...

Getting One Row From A DW
I am trying to create a function that will retrieve a single row from a database and return the contents of the columns in that row back to the calling routine. Here is a section from the PB help file regarding the use of dot notation to access a rows-worth of data: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// dwcontrol.Object.Data {.buffer } {.datasource } { [ rownum ] } Returns one structure or user object (for a single row) or an array of them (for all rows). The structure elements match the columns i...

SQL: mutiple rows one column to multiple columns one row
In InfoMaker SQL can you take a table with multiple rows for the same key and take a column from the rows and create mutiple columns with one report line with the key(no duplicate keys) on a report? For example Table books (key) (book title) 123 misery 123 titanic 123 roots 456 war 456 1984 456 giant The report I need would look like this Key title1 title2 title 3 123 misery titanic roots 456 war 1984 giant Thanks in advance. -- Kaye Hendry HealthInsight email:kaye.hendry@healthinsight.org ...

SQL -- getting one row problem
Good afternoon, Here is the output of my script, and can’t understand why this is not working. Thanks for any and all pointers! Dave Gilden someone@monsoon:~/cgi-bin$ mail_guest_to_jk.cgi Use of uninitialized value in concatenation (.) or string at ./mail_guest_to_jk.cgi line 33. Use of uninitialized value in concatenation (.) or string at ./mail_guest_to_jk.cgi line 37. DBD::mysql::st execute failed: You have an error in your SQL syntax near '' at line 1 at ./mail_guest_to_jk.cgi line 60. DBD::mysql::st fetchrow failed: fetch() without execute() at ./mail_guest_to_jk.c...

Getting all columns for one database row
I am trying to be able to print out different fields of a database record, and I am not finding a sinple way to do this. I know in ASP to print data from a column I could just do a: <% Response.Write tempRS("name") %> But I am not finding anything similar available in ASP.NET. Can anyone help me here? Look at the DataGrid Control, it's probably one of the most documented controls that asp.net has, so you will find plenty of examples on how to use it.Ask and it will be given to you; seek and you will find; knock and the door will be opened to you. Luke 11:9 how are you ...

how to drag and drop one row from one datawindow and update the exist row in other datawindow ?
I liked to drag and drop a field (assume: name) from a row of one datawindow (dw_1) to another datawindow (dw_2), and also update the exist row in dw_2. Thanks for help. -- Best regards, Ridwan Goldbase Technology Visit our Homepage : http://www.geocities.com/Wallstreet/Floor/5251/index.html http://members.tripod.com/goldbase http://members.xoom.com/goldbase * Check out the Y2K (Year 2000 Problems - Millenium Bugs) Take a look at the Drag Drop entries in the help file. Basically, you need to turn on Dragging using Drag(Begin!). When you drop onto dw_2, the drag...

Reduce rows displayed but putting 3 rows in one row
Hi all, I'm using PB6.5. I have an SQL DW that fetch some information from the DB but should display only two columns: a code and a value. Also they are displayed in the trailer of a group if that's actually important. In order to reduce displayed rows count, i would like to display each 3 rows in one row(Code,Value,Code,Value,Code,Value). The question is how can i do that?. I've tried to use computed fields and in the second and third pair values to use code[1],value[1],code[2],value[2] but only the code[1],value[1] are OK(Showing next row's data), the third ...

selecting one row and inserting it into another table one by one
i ve a table named "Employee" in wh i ve fields "Emp_Id","Name" and "Email". i want to select each employee "Emp_Id" one by one from "Employee" table and insert it into another table named "Concerned_Department". like if i ve three rows in "Employee" table with "Emp_Id" 1,2 and 3 respectively,in this case i want to first select "Emp_Id"=1 then "Emp_id"=2 and lastly "Emp_id"=3 and insert them into "Concerned_Department"table.  after that the process star...

Get every thing of one row from table
In ISQL I want to select one row of every thing in a table. How do I do it?? I user select * from tablename where @@rowcount = 1 NOT WORKING select * from tablename where @@total_read = 1 NOT WORKING select * from tablename where @@trancount = 1 NOT WORKING Please help me I not sure what your looking for exactly but here is a guess. set rowcount 1 go select * from tablename go "CityLightSybase" <matthew.do@ci.seattle.wa.us> wrote in message news:01c11f80$64f77b20$56cc4a9c@MD14078... > In ISQL I want to select one ro...

Web resources about - Get resultset in one row - sybase.powerbuilder.general

'jdbc' Top Users - Stack Overflow
Q&A for professional and enthusiast programmers

IBM Remote Supervisor Adapter - Wikipedia, the free encyclopedia
This is a full-length ISA or PCI adapter. The ISA version is very rare, and was only ever supported in one or two servers. This adapter can be ...

Java Developer Kit (JDK) Search Engine
Java Developer Kit (JDK) Search Engine


Java 7 Runtime and Cloud Endpoints Preview
... public static void viewTable(Connection con, String query) throws SQLException { try ( Statement stmt = con.createStatement(); ResultSet rs ...

The (Submission) Grinder
The market search page is very powerful and fliexible but can be daunting to new users. Here is a quick run down on how things work. The filters ...

All Packages from $.* to Freenet.*
Package Samples: Freenet Freenet.client Freenet.contrib.fproxy Freenet.message Freenet.crypt Freenet.node Freenet.support ...

The Goldman Sachs Group, Inc. - Selected Consolidated Financial Data
The selected historical consolidated income statement and balance sheetdata set forth below have been derived from Goldman Sachs' consolidatedfinancial ...

Clones of dapper-dot-net - dapper-dot-net - Simple SQL object mapper for ADO.NET - Google Project Hosting ...
My favorites ▼ - Sign in dapper-dot-net Simple SQL object mapper for ADO.NET Project Home Downloads Wiki Issues Source Repository: default wiki ...

A simple Delphi wrapper for Sqlite 3
Most applications use a database, and there are many excellent database engines to choose from, both free and commercial. SQLite is a smal

Resources last updated: 1/16/2016 9:02:37 AM