Click here to Skip to main content
15,921,028 members
Home / Discussions / Database
   

Database

 
GeneralRe: numeric data type value Pin
Mairaaj Khan14-Jul-06 2:02
professionalMairaaj Khan14-Jul-06 2:02 
GeneralRe: numeric data type value Pin
For_IT14-Jul-06 3:11
For_IT14-Jul-06 3:11 
AnswerRe: numeric data type value Pin
Heinz_15-Jul-06 14:27
Heinz_15-Jul-06 14:27 
Questionwhere not exists problem! Pin
richiemac13-Jul-06 23:19
richiemac13-Jul-06 23:19 
AnswerRe: where not exists problem! Pin
Mike Dimmick14-Jul-06 0:23
Mike Dimmick14-Jul-06 0:23 
AnswerRe: where not exists problem! Pin
Eric Dahlvang14-Jul-06 3:21
Eric Dahlvang14-Jul-06 3:21 
AnswerThanks for the help guys Pin
richiemac14-Jul-06 3:35
richiemac14-Jul-06 3:35 
GeneralRe: Thanks for the help guys Pin
Eric Dahlvang14-Jul-06 5:50
Eric Dahlvang14-Jul-06 5:50 
richiemac wrote:
insert into mytable values(default,?number,?text,?date) select * from mytable where not exists(select * from mytable where int_field = '20')


You are inserting into mytable, and yet you are selecting from my table also. This is perfectly legal, however...it will insert duplicates into the table - if that is what you want.

Select * from mytable where not exists(select * from mytable where int_field = '20')
This will return NO records if there is a value of '20' in int_field for ANY record in mytable.


I don't fully grasp what you are trying to do, but look at this example of using exists in an insert into:
Three tables named (tblPeople,tblYoungPeople,tblDeadPeople)
All three have fields (PeopleID,LastName,FirstName,Age)

To fill the tblYoungPeople table with all people under 40 who are not dead, you would do this:
insert into tblYoungPeople (firstname,lastname,age)
 select firstname,lastname,age from tblPeople p
        where p.age < 40 AND not EXISTS(SELECT * from tbldeadpeople dp WHERE dp.peopleid = p.peopleid)




--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

AnswerRe: where not exists problem! Pin
Eric Dahlvang14-Jul-06 7:23
Eric Dahlvang14-Jul-06 7:23 
GeneralRe: where not exists problem! Pin
richiemac16-Jul-06 22:18
richiemac16-Jul-06 22:18 
Questionmaintaining the data type Pin
Jerry Hammond13-Jul-06 20:20
Jerry Hammond13-Jul-06 20:20 
AnswerRe: maintaining the data type Pin
Mike Dimmick14-Jul-06 0:24
Mike Dimmick14-Jul-06 0:24 
GeneralRe: maintaining the data type Pin
Jerry Hammond14-Jul-06 5:24
Jerry Hammond14-Jul-06 5:24 
QuestionMatch Case Comparision Pin
sumit siddheshwar13-Jul-06 18:23
sumit siddheshwar13-Jul-06 18:23 
AnswerRe: Match Case Comparision Pin
Edbert P13-Jul-06 19:26
Edbert P13-Jul-06 19:26 
GeneralRe: Match Case Comparision Pin
sumit siddheshwar13-Jul-06 20:07
sumit siddheshwar13-Jul-06 20:07 
AnswerRe: Match Case Comparision Pin
Mairaaj Khan14-Jul-06 3:06
professionalMairaaj Khan14-Jul-06 3:06 
QuestionTo many SQL Data Sources? Pin
Drathmar13-Jul-06 17:06
Drathmar13-Jul-06 17:06 
AnswerRe: To many SQL Data Sources? Pin
Colin Angus Mackay13-Jul-06 22:00
Colin Angus Mackay13-Jul-06 22:00 
AnswerRe: To many SQL Data Sources? Pin
mysorian15-Jul-06 4:47
professionalmysorian15-Jul-06 4:47 
QuestionA simple query :( [modified] Pin
xoxoxoxoxoxox13-Jul-06 16:35
xoxoxoxoxoxox13-Jul-06 16:35 
AnswerRe: A simple query :( Pin
Andrew Bleakley13-Jul-06 17:51
Andrew Bleakley13-Jul-06 17:51 
GeneralRe: A simple query :( Pin
xoxoxoxoxoxox13-Jul-06 17:58
xoxoxoxoxoxox13-Jul-06 17:58 
GeneralRe: A simple query :( Pin
Andrew Bleakley13-Jul-06 18:12
Andrew Bleakley13-Jul-06 18:12 
QuestionDataadapter UpdateCommand Pin
kedar.dave13-Jul-06 12:01
kedar.dave13-Jul-06 12:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.