|
Perform a LEFT JOIN betweeb tblemployees and tblbank. Rows on the left-hand side of the join will be preserved, so all employees will be listed regardless of whether they have bank details.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi all
i need to retrieve values from two tables which is common....
EX:-
Table1 Table2
Itemno ItemName SNo ItemName
1 pen 1 Pencil
2 paper 2 pen
here i should get the result as
pen
paper
pencil
how to write a query for this?...
can anybody help me?
|
|
|
|
|
Hello Sandhya!
Try this.
select ItemName from Table1 <br />
union all<br />
select ItemName from Table2
Keep Smiling
|
|
|
|
|
|
I'm upgrading classic asp to asp.net. Through out the code I see whenever there is an insert to the database it is done in two steps. First it does an insert with minimal fields to get an id of the new record then the record is updated on subsequent lines of code.
Doesn't it make a sense to do the whole operation in a single insert? Is there a valid reason or advantage doing it in two steps?
/* I can C */
// or !C
Yusuf
|
|
|
|
|
Yusuf wrote: Doesn't it make a sense to do the whole operation in a single insert?
Yes.
Yusuf wrote: Is there a valid reason or advantage doing it in two steps?
So the original author doesn't need to learn how to do it in one step.
|
|
|
|
|
Looks like a case of code that was written for testing was then changed to live code.
With the information you have provided I can see no reason to need to do this.
The only time it may be useful is in an OLTP system where thousands of users need to create records at high speed and recover the id (for call logging purposes for instance), as you say, before inserting a large amount of data in a row.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
HI could anyone tell me how to find all the disabled trigers in the database?
Mujtaba
"If both of us are having one apple each and we exchange it, at the end we both will have one apple each. BUT if both of us are having one idea each and we exchange it, at the end both of us will be having two ideas each."
|
|
|
|
|
This should help you Clickety
You may need to make a few changes but the general gist of it is all there.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
im working on windows applicaction and i want to support th ehijri calnder (islamic calnder)
the year 1428 will be 2007.
but when im trying to inser new filed gave me out of range (1765<)
here is some examples:-
declare @x datetime
set @x= convert(datetime ,'01/01/1428',131)
print @x the result is ===> "Jan 19 2007 12:00AM"
convert from hijri to gregorian worked well
but
declare @x datetime
set @x= convert(datetime ,'01/01/1482',101)
print @x the result is ===>
"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
" tha means cant convert from hijri to gregorian
so plz what is the best method for me to accept the both pc calender setting for my application.
regards
|
|
|
|
|
Here is a clue.
Try both of these queries:
<br />
declare @x datetime<br />
set @x= convert(datetime ,'01/01/1428',131)<br />
print @x <br />
<br />
print convert(datetime ,'01/19/2007',101)<br />
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
hi all,
i m trying to store the path of file in mysql database using vb.net. This path contains "\" but Mysql database does not store it. Also when i directly edit or enter(or using php) the field in database and insert "\" in database field then it stores backward slash.
anybody have idea where i m wrong. I am using MySql.Data.dll(ver. 5.1.2.2) for connect .net to MYSQL ?
any help will be greatly appreciated.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Google for 'escape characters' and you will find out how to do it
|
|
|
|
|
hi
i need to access the server machine's current date and time? Pls any body explain me in detail how to do this . since i am a beginner, i find it difficult to perform this.
Help me
thanks in advance
kssk
kssk
|
|
|
|
|
You can use the system-function GetDate() in your SQL statements to get the current date and time.
modified on Monday, December 17, 2007 4:01:05 AM
|
|
|
|
|
I am an oldy trying out some stuff with VB.net - Access coding. My code is almost complete; however, I am having an error populating a charater field. There are five fields in the table seasonNo [integer], sYear [integer], seasObs [double], seasSim [double], and season [char]. In the season field I want to write season of the year. However, with the code below if I replace 1 (last field in cmd line) with sea(im) or eg. "winter", the command gives error. There is no error if it is 1. Any help to remove the error will be greatly appreciated.
Dim sea() As String = {"Winter", "Spring", "Summar", "Fall"}
For ir = 0 To ty - 1
imYear = minYear + ir
For im = 1 To 4
cmd = "insert into seasonSummary VALUES (" & im & " , " & imYear " , " seasObs(im, ir) & " , " & seasSim(im, ir) & " , " & 1 & ")"
dbCmd = New OleDbCommand(cmd, myConnection)
dbCmd.ExecuteScalar()
Next
Next
|
|
|
|
|
What's the structure of the seasonSummary table? What's the error message you get?
|
|
|
|
|
i need query for join three tables in sqlserver 2000 i created three tables i need to join the three tables with single line query
send to me
Dhilip.K.K.
|
|
|
|
|
<br />
select P1.title,P1.name,C1.Courtesy,G1.LookHereFirst <br />
from Politeness P1<br />
join Courteous C1<br />
on P1.name = C1.name<br />
join Google G1<br />
on G1.Courtesy = C1.Courtesy<br />
where <br />
C1.Text = 'Saying please never harmed anyone'<br />
and G1.Text = 'How about having a look in google first next time'<br />
and P1.Text = 'Read between the lines'<br />
You always pass failure on the way to success.
|
|
|
|
|
|
|
Glad you liked it,
That was a bit impatient of me - it's just the "give it to me" attitude that I get really irritated with.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
It is a bit long to use for a sig, but hey, maybe I will use it anyways :->
GuyThiebaut wrote: the "give it to me" attitude that I get really irritated with
You aren't the only one irritated by those types of posts.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
It's a shame that I can't top Guy's answer. It is superb and gets to the point quickly and efficiently, when you have a question ask it politely.
Dhilipkumar wrote: i created three tables
I'm glad that you created three tables - it shows that you are a better carpenter than a coder. Perhaps you'd like to stay in that line.
Dhilipkumar wrote: i need to join the three tables
You might want to consider just pushing them together. That's what we will be doing at Christmas to make room for everybody.
|
|
|
|
|
You need a basic SQL reference manual. Perhaps O'Reilly's SQL Cookbook[^] would help you.
I could post a sample query but I really don't think you'd understand it, and the time and space to explain it isn't suitable for this forum.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|