hello,
how to select a table that has a highest amount of columns (compared
to other tables) using syscat?
thanks in advance 4 4692
d0m_at0m wrote:
hello,
how to select a table that has a highest amount of columns (compared
to other tables) using syscat?
I can't imagine how this would be useful, but:
select tabschema, tabname, count(*) as num_cols
from syscat.columns
group by tabschema, tabname
order by 3 desc
fetch first 1 row only;
On May 23, 4:30 am, d0m_at0m <2lazy2sl...@gmail.comwrote:
hello,
how to select a table that has a highest amount of columns (compared
to other tables) using syscat?
thanks in advance
even this may work i think ..
select * from syscat.tables
where colcount=(select max(colcount) from syscat.tables)
On May 23, 4:54 am, Ian <ianb...@mobileaudio.comwrote:
d0m_at0m wrote:
hello,
how to select a table that has a highest amount of columns (compared
to other tables) using syscat?
I can't imagine how this would be useful, but:
select tabschema, tabname, count(*) as num_cols
from syscat.columns
group by tabschema, tabname
order by 3 desc
fetch first 1 row only;
even it may work i think ..
select * from syscat.tables
where colcount=(select max(colcount) from syscat.tables)
situ wrote:
On May 23, 4:54 am, Ian <ianb...@mobileaudio.comwrote:
>d0m_at0m wrote:
hello,
how to select a table that has a highest amount of columns (compared
to other tables) using syscat?
I can't imagine how this would be useful, but:
select tabschema, tabname, count(*) as num_cols from syscat.columns group by tabschema, tabname order by 3 desc fetch first 1 row only;
even it may work i think ..
select * from syscat.tables
where colcount=(select max(colcount) from syscat.tables)
SELECT *
FROM syscat.tables
ORDER BY colcount DESC
FETCH FIRST 1 ROW ONLY
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tcs |
last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't
loaded it yet. I'm still using MS Access. And no, I don't believe this is an
Access question. (But who knows? I...
|
by: Jean |
last post by:
Hi,
how to know for a particular table if it is organized by index, and which
one ?
reorg table index ind1 -> the table is organised by ind1
i wan't to know that for all table
thx
|
by: selma |
last post by:
I am puzzled by visual explain for a simple query ( select * from
mytable ) chooses an index scan. That index has only a single column
and the table has 30 columns not covered by the index. When...
|
by: Markus |
last post by:
I created a Stored Procedure like this:
CREATE PROCEDURE myProcedure(IN a_tabschema VARCHAR(20))
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
DECLARE rs CURSOR WITH RETURN FOR
SELECT * FROM...
|
by: Bob Stearns |
last post by:
Several weeks ago I asked what comments I could pass to DB2 in a SELECT
statement. I don't remember whether I said via PHP/ODBC. I was assured
that both /* */ style comment blocks and -- comment...
|
by: Konstantin Andreev |
last post by:
Recently I became interested, - Are the data, bulk loaded in the table with
LOAD utility, consume the same disk space as loaded with IMPORT utility? The
answer turned out to be NOT !
Here is a...
|
by: RGow |
last post by:
Hi all,
Is there a way to retrieve or reconstruct the SQL that was used to
create a particular table in DB2? I'm looking for something similar to
the contents of the 'SYSCAT.ROUTINES.TEXT', but...
|
by: Chris |
last post by:
Can't seem to figure out how to do this and have been reading for some
time now......
I want to select a row count from a table name in SYSTABLES.
This statement does not return what I needed,...
|
by: Okonita |
last post by:
Hi all,
How can I implement using REORGCHK to tell REORG what DB2 UDB v8
tables, etc to perform REORG on?
Any example script will be highly appreciated.
Okonita
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |