473,320 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

select 1 + 1

5
Hola

necesito hacer una simple suma de dos sentencias en db2 con una select, me podéis dar una idea por favor?, he trabajado mas con sybase y con sybase podia hacer por ejemplo: select 1 + 1 , quiero hacer algo parecido db2 pero esto no me funciona

quiero sumar dos sentencias, algo asi:

select count(campo) from tabla1 where condicioncualquiera +
select count(campo) from tabla2 where condicioncualquiera.

muchisimmaaa gracias!
Oct 17 '06 #1
2 1226
r035198x
13,262 8TB
Hola

necesito hacer una simple suma de dos sentencias en db2 con una select, me podéis dar una idea por favor?, he trabajado mas con sybase y con sybase podia hacer por ejemplo: select 1 + 1 , quiero hacer algo parecido db2 pero esto no me funciona

quiero sumar dos sentencias, algo asi:

select count(campo) from tabla1 where condicioncualquiera +
select count(campo) from tabla2 where condicioncualquiera.

muchisimmaaa gracias!
English please
Oct 17 '06 #2
jmaria
5
English please
Hello

I need to do a simple sum with two selects in db2, each select is the count's results.
Please, could you give me an idea, how to do this?. I need to have the result with one query only.

I want to get the sum of the two counts, from queries like this:

select count(a) from table1 where b=c + select count(q) from table2 where z=y

I have worked with sybase, not with db2, With sybase I can do "select 1 + 1", but in db2 this don't work.

Sorry for my english

Thanks!!
Oct 17 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
4
by: Elroyskimms | last post by:
Using SQL 2000... tblCustomer: CustomerID int CompanyName varchar(20) HasRetailStores bit HasWholesaleStores bit HasOtherStores bit tblInvoiceMessages:
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
3
by: dumbledad | last post by:
Hi All, I'm confused by how to replace a SELECT statement in a SQL statement with a specific value. The table I'm working on is a list of words (a column called "word") with an index int...
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
1
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the...
9
chunk1978
by: chunk1978 | last post by:
hey everyone, i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help. EXPLANATION: There are 3 Select Menus. The 1st and...
2
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file:...
4
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. ...
6
by: Apaxe | last post by:
In the database i have a table with this information: key_id =1 key_desc =43+34+22+12 I want sum the values in key_desc. Something like: SELECT key_desc FROM table But the result of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.