Search
 
SCRIPT & CODE EXAMPLE
 

SQL

get columns number sql

#With SQL

SELECT count(*)
FROM information_schema.columns
WHERE table_name = 'Your_table_name';
Comment

get columns number sql

//With JAVA

String quer="SELECT * FROM sample2 where 1=2";

Statement st=con.createStatement();
ResultSet rs=st.executeQuery(quer);
ResultSetMetaData rsmd = rs.getMetaData();
int NumOfCol=0;
NumOfCol=rsmd.getColumnCount();
System.out.println("Query Executed!! No of Colm="+NumOfCol);
Comment

sql number columns

SELECT TABLE_NAME , count(COLUMN_NAME)
FROM information_schema.columns
GROUP BY TABLE_NAME;

-- Oracle (depending on schema grants):
SELECT count(*) FROM USER_TAB_COLS WHERE TABLE_NAME = 'my_table';
SELECT count(*) FROM ALL_TAB_COLS WHERE TABLE_NAME = 'my_table';
SELECT count(*) FROM DBA_TAB_COLS WHERE TABLE_NAME = 'my_table';
Comment

PREVIOUS NEXT
Code Example
Sql :: cannot pip install mysqlclient 
Sql :: search column name sql 
Sql :: pip install mysqlclient error 
Sql :: query to check cpu utilization in oracle database 
Sql :: oracle drop chain step 
Sql :: concat first name and last name in mysql 
Sql :: oracle set sequence value to max(id) 
Sql :: mysql left join exists 
Sql :: t-sql disable system versioning 
Sql :: having count greater than 1 mysql 
Sql :: current setting postgres timezone 
Sql :: psql restore from tar 
Sql :: sql throw error 
Sql :: psql autocomplete for mac brew install 
Sql :: postgresql get current user name 
Sql :: delete entries in postgresql 
Sql :: oracle list data files 
Sql :: set boolean flasksql 
Sql :: psql human readable 
Sql :: sql select column names 
Sql :: mysql current user 
Sql :: change table to innodb mysql 
Sql :: insert random numbers in columns postgress 
Sql :: conda install pymysql "windows" 
Sql :: Sql creating roles 
Sql :: drop all database tables oracle sql developer 
Sql :: datetime add 2 hours sql 
Sql :: alter table in mysql 
Sql :: Syntax of for-loop in SQL Server 
Sql :: mysql public key retrieval is not allowed 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =