SELECT TOP Problem


I want to select second part of 20 to rows of a database. I write this SQL Command : SELECT TOP 20,10 * FROM Marks But it is not work ! what is my fault please
Posted On: Wednesday 21st of November 2012 02:46:27 AM Total Views:  59
View Complete with Replies

RELATED TOPICS OF Oracle PROGRAMMING LANGUAGE




how to fire insert, select query if 1 datatype is xml and other is normal?

I want insert selct query for following Mailed_from\t\t\t\t\t\t varchar Mailed_date\t\t\t\t\t\t Datetime Mailed_to\t\t\t\t\t\t\t\t Xml here xml is used to store more than 1 MAil id
VIEWS ON THIS POST

261

Posted on:

Wednesday 7th November 2012
View Replies!

MySql select Statement

I have a web application in asp.net that connects to mySql database to grab and display the information. I need to display the latest record. for that this statement is working fine. Select timestring, pwr_vin, dsp_dig_in_6, pwr_temp from soh_data order by timestring desc limit 1 But when I want to display all the columns with the statement below. it gives error message mysql date/time value doesnot match with system time. Select* from soh_data order by timestring desc limit 1 The table has about 80 columns. so I don't want to hard code them in the sql statement. what could be the solution. If think about stored procedures, need to be stored with database, but it is a read only databse. Any alternatives.
VIEWS ON THIS POST

283

Posted on:

Wednesday 7th November 2012
View Replies!

URGENCE- Problem with select in Oracle

I have a simple search query that works in both Oracle and SQL SERVER. When I search for something in SQL SERVER it gives more result than Oracle. I belive it is case sensitive in Oracle. For example in SQL SERVER I could write "pipet "and it returns me everything regardless of the format and cases, but in Oracle it doesn't give me those "Pipet" which start with capital. it gived exactly as it is entered. I have to mention the page, the data type, and the data are all the same in these two databases.Is there anything that I should to change that except having OR in my queries for both uppercase and lower cases. //name is a text box to String myText = name.ToString(); SELECT * from MyTable where product_Desc LIKE '%" + myText + "%' Is there a better way to write such a select in order to be more accurate and include upper and lower cases.
VIEWS ON THIS POST

274

Posted on:

Wednesday 7th November 2012
View Replies!

URGENCE - Problem with select query in Oracle

I have a simple search query that works in both Oracle and SQL SERVER. When I search for something in SQL SERVER it gives more result than Oracle. I belive it is case sensitive in Oracle. For example in SQL SERVER I could write "pipet "and it returns me everything regardless of the format and cases, but in Oracle it doesn't give me those "Pipet" which start with capital. it gived exactly as it is entered. I have to mention the page, the data type, and the data are all the same in these two databases.Is there anything that I should to change that except having OR in my queries for both uppercase and lower cases. //name is a text box to String myText = name.ToString(); SELECT * from MyTable where product_Desc LIKE '%" + myText + "%' Is there a better way to write such a select in order to be more accurate and include upper and lower cases.
VIEWS ON THIS POST

245

Posted on:

Wednesday 7th November 2012
View Replies!

GridView+MySql...selected item send to another page

I i'm beginner in ASPNET 2.0,but i would like to select all item in a table like this SELECT * FROM mytable then fill it to a GridView(named it GridView1) then the item that showed when user click it,it will be send to another page...like this Response.Redirect("test.aspxitemSelect=" + itemName); this is my code..... MySqlConnectionconn; stringConnectionString; ConnectionString="server=localhost;uid=USERNAME;database=mydatabase;"; conn=newMySqlConnection(); conn.ConnectionString=ConnectionString; MySqlCommandcmd=newMySqlCommand(); cmd.CommandText="SELECTFilePath,ICFROMfileatserverWHEREIC=\tIC"; cmd.Connection=conn; cmd.Parameters.Add("IC",MySqlDbType.VarChar,45).Value=LoginName; MySqlDataAdapterMyDataAdapter=newMySqlDataAdapter(cmd); SqlDataSourceData1=newSqlDataSource(); Data1.ProviderName="MySql.Data.MySqlClient"; Data1.SelectCommand=cmd.CommandText; Data1.ConnectionString=ConnectionString; Data1.DataBind(); DataSetdatasettKu2=newDataSet(); MyDataAdapter.Fill(datasettKu2,"fileatserver"); GridView1.DataSource=datasettKu2; //GridView1.DataKeyNames="FilePath"; GridView1.DataBind(); i'm using .NET Framework Data Provider for MySQL (using MySql.Data.MySqlClient;) data that i want to send to another page is in "FilePath" column or i have another choice to view all data and send selected item to another page \t please help me.
VIEWS ON THIS POST

172

Posted on:

Wednesday 7th November 2012
View Replies!

Trying to select names that begin with a letter, using WHERE xxx LIKE problem

SelectCommand="SELECT firstName, lastName, position, phone FROM phone WHERE (lastName LIKE + '%')"> \t\t This is what I have set up in a aspx file created with vwd. I had to remove [ ] from all of the field and table enteries. My problem is that I cannot get the select statement to work as I want. What I want to do is to take a single letter input ('s' for example) from a textbox control and return all last names that start with 's'. If I put in 'smith', my gridview will return with all the 'smith's' as expected. If I put in s, I don't get anything, except the textbox and the submit button. I tried the '%' + + '%' that was created by VWD when I added the WHERE clause, but this doesn't work either. Anyone got any joy for me
VIEWS ON THIS POST

253

Posted on:

Wednesday 7th November 2012
View Replies!

Why select count(*) is faster than select count(1)?

Why select count(*) is faster than select count(1) I thought count(*) will take longer as oracle need to find out all the column names from dictionary ...
VIEWS ON THIS POST

209

Posted on:

Monday 12th November 2012
View Replies!

select in pl/sql

Hi Does anyone know how can you put queries in pl/sql like select * from emp inside a pl/sql block and then output the results in sqlplus
VIEWS ON THIS POST

179

Posted on:

Thursday 15th November 2012
View Replies!

select distinct count on different dates

I want to select count of distinct requests for different statuses on different days like today, yesterday and day-before-yesterday from sample table, please guide me in this regard. Currently using following query where i get daily count. columns: req_Status, req_id,sent_date select req_status, count(distinct(req_id)) as REQ_TODAY, MIN(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Min_sent_date, MAX(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Max_sent_date,'1-NEW Command' Meaning_of_Status from sample where sent_date like sysdate and req_status=1 group by req_status union select req_status, count(distinct(req_id)) as REQ_TODAY, MIN(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Min_sent_date, MAX(to_char(SENT_DATE,'DD-MON-YY - HH:MI:SS')) as Max_sent_date,'2-old Command' Meaning_of_Status from sample where sent_date like sysdate and req_status=2 group by req_status union . . and so on... column req_status has values in range from 1 to 12 output: REQ_STATUS REQ_TODAY MIN_SENT_DATE MAX_SENT_DATE MEANING_OF_STAT ------------- ------------ --------------------- --------------------- ------------------- 1 3 25-JUL-12 - 06:47:20 25-JUL-12 - 07:28:24 1-NEW Command 2 3 25-JUL-12 - 06:47:20 25-JUL-12 - 08:07:10 2-old Command 3 3 25-JUL-12 - 06:47:20 25-JUL-12 - 08:07:29 3-wrong Command . . so on for 12 REQ_STATUSes In this output I need two more columns that will depict count of requests for different statuses for last two days as follows : REQ_STATUS | REQ_CNT_DB4YEST | REQ_CNT_YEST | REQ_TODAY | MIN_SENT_DATE | MAX_SENT_DATE | MEANING_OF_STAT
VIEWS ON THIS POST

313

Posted on:

Thursday 15th November 2012
View Replies!

SAMPLE BLOCK in select

What is the implication of the SAMPLE BLOCK(1) in the following query SELECT COUNT(*) from TABLE_A SAMPLE BLOCK(1) I assumed that this would return all of the rows in the first block of the TABLE_A data segment, but the number of rows that is being returned is over 100,000 and with a 16K block size I can hardly believe that there are that many rows in one block.
VIEWS ON THIS POST

203

Posted on:

Thursday 15th November 2012
View Replies!

rowid select all

Hi Friends, I want to spool my table to text format and i want to include the rowid. I have also long list of columns in this table. Is there a short-way to select all columns in a table + rowid Like >> select *,rowid from table_a;
VIEWS ON THIS POST

230

Posted on:

Thursday 15th November 2012
View Replies!

query to select users and jobs running

How do I select users and jobs they are doing for an instance in sqlplus \t
VIEWS ON THIS POST

182

Posted on:

Friday 16th November 2012
View Replies!

Problem with select data. Help!

I try to select data from my database where i will pull the data based on latest time and group by name. below are the sample data: ID Name Starttime Endtime 1 AAA 1/5/2012 8.00am 1/5/2012 10.00a.m 2 BBB 2/5/2012 9.00a.m 3 CCC 2/5/2012 10.00a.m 2/5/2012 3.00pm 4 AAA 2/5/2012 10.00a.m selectID,Name,Max(Start_Time),End_TimefromchambergroupbyName System will return me data as below: ID Name Starttime Endtime 2 BBB 2/5/2012 9.00a.m 3 CCC 2/5/2012 10.00a.m 2/5/2012 3.00pm 4 AAA 2/5/2012 10.00a.m 1/5/2012 10.00a.m System will automatic replace the empty value on End_Time on 'AAA' Can someone help me to fix the error.
VIEWS ON THIS POST

146

Posted on:

Tuesday 20th November 2012
View Replies!

select column with commas

i have an select statement like below... a b c d e 36 ACSACSREQ Test Role 49 A 36 ACSACSREQ Test Role 49 B 36 ACSACSREQ Test Role 49 C 36 ACSACSREQ Test Role 49 D 36 ACSACSREQ Test Role 49 E 36 ACSACSREQ Test Role 49 F all column has been repeated expect the e th column. i want to get this record in single row in erow will merge with commas. like below. pls check & give me the solution... a b c d e 36 ACSACSREQ Test Role 49 A,B,C,D,E,F
VIEWS ON THIS POST

142

Posted on:

Tuesday 20th November 2012
View Replies!

How to select the "row before and after" a singlerowselection?

For example: (itemID is unique) Select * where itemID='100' Now I would also like to select the row that is present above this row, and the row following this row. How shall I proceed The ItemID's are random numbers.
VIEWS ON THIS POST

146

Posted on:

Tuesday 20th November 2012
View Replies!

Problem selecting boolean value within BLL

Hi There, I have a 3 layered web application. My table have a string columm to identify a true/false value, My DAL works fine, but on my presentation layer I use a third party control that fills a variable with a boolean value. Since I can't change the control, neither configure the columm to a boolean columm, my way out of this is to solve the problem on my insert method on the BLL. So I have a class witch creates a adapter corresponding to the dataset tableadapter, in the class I have the method configured to make the adapter.GetData(), of course that an error occurs since I'm trying to assign a string value from DB to a boolean value on my control, So the question is... How do I treat my GetData() method to chance de datatable schema before returning the wrong variable type! I've considered using a loop inside the method to change one by one, but in a many million lines table, I guess that would strongly affect my application's performance...
VIEWS ON THIS POST

161

Posted on:

Tuesday 20th November 2012
View Replies!

insert and select data

hi i am using visual studio and sql server 2005 with language C#. my requirement in project is to select data from another database and insert data into database - which is in MySQL. i need help how i can do by using C# and related technologies.
VIEWS ON THIS POST

160

Posted on:

Tuesday 20th November 2012
View Replies!

Excel select xyz from [sheet1$]

In my excel sheet1 I have some records. The column name xyz contains some alphanumeric text and smoe pure numbers. When I do select xyz from [sheet1$] it shows me only numbers and not the alphanumeric text. I tried formatting the entire column into text and again fired the query I still not resolved the problem
VIEWS ON THIS POST

161

Posted on:

Wednesday 21st November 2012
View Replies!

Return values from select query

, I have a this query in my C# code string sqlStr; int BrokerRecord; CoreLab.Oracle.OracleConnection Conn = new CoreLab.Oracle.OracleConnection(); string ConnStr = System.Configuration.ConfigurationSettings.AppSettings["ConnStr"]; Conn.ConnectionString = ConnStr; string passing=Request.QueryString["text"].ToString() ; sqlStr = "select count(t.entity_name) from cm_brokers_profile t "+ " where t.entity_name =passing"; I would like to make a conditional statement depending on the result of this query. I am doing this BrokerRecord = Convert.ToInt32(sqlStr); if (BrokerRecord > 0) I get error message for doing this. Can anyone give me a hand. I do not know how to get the result of the query
VIEWS ON THIS POST

275

Posted on:

Wednesday 21st November 2012
View Replies!

select statement in oracle stored procedure

how do can i use select statement in oracle's stored procedure that returns rows(SELECT * FROM USERS). In sql server i can just call the issue the select statement directly but not in oracle.
VIEWS ON THIS POST

187

Posted on:

Wednesday 21st November 2012
View Replies!