JCJCJC


I would like to run a query for get contious data

( like data_no=1 and data_no=2 ..... and data_no=2)

I only know to run a query for get single data

for example:

select data_no

from tableA

where data_no=1

if I want to select mutiple and continue data what can I do

after get data how can I insert mutiple data to DB for 1 query

many thanks




Re: some problem of Querie for "Select" & "Insert"

Geert Verhoeven


Hi,

Can you please explain a few things in order to get the problem right.

Are the other records in the same table If so, you can do the same select statement without using the WHERE clause. This will then return all the results in the table.

Greetz,

Geert

Geert Verhoeven
Consultant @ Ausy Belgium

My Personal Blog







Re: some problem of Querie for "Select" & "Insert"

JCJCJC

hi yes, records in the same table.

in table name student I have data NO 1~NO 50

my problem is if I want to select data which NO is 1 I would do this select * from student where no=1

if I want to select NO1~NO10 I've no idea how to do it..






Re: some problem of Querie for "Select" & "Insert"

Nitin Khurana

u can use 'order by no'.. various commbinations from there on..

select top 10 * from student

order by no

or do this..

select * from student where no <11

order by no

etc.ctc...

for inserting into other table..

insert into 'tablename'

select * from student where no <11

order by no






Re: some problem of Querie for "Select" & "Insert"

JCJCJC

thanks

but that's not what I mean ( sorry for confused)

if I want to select No 2348~ NO 2982 .. I can't do "order by"

select member_no

from member

where member_no= 2348

---------------------------------------

select member_no

from member

where member_no =2349

.....

I hope I can do query in once need not to do many times ... is it possible





Re: some problem of Querie for "Select" & "Insert"

Louis Davidson

What about:

select member_no
from member
where member_no >= 2348
and member_no <= 2982

You can combine many different criteria in the where clause.






Re: some problem of Querie for "Select" & "Insert"

Geert Verhoeven

Here is a good tutorial to get familiar with SQL: http://www.w3schools.com/sql/default.asp

Greetz,

Geert

Geert Verhoeven
Consultant @ Ausy Belgium

My Personal Blog






Re: some problem of Querie for "Select" & "Insert"

JCJCJC

thanks you all

my problem has been resolved.