|
Hi All,
greetings.In my appilcation i need to take two different data that is EmployeeName from Employee Table and ClientName from Client Table.How i can write it in a single SQL Query.
Can any one one give me the query please.
Thanks in Advance.
Babu
|
|
|
|
|
ChennaiBabu wrote: In my appilcation i need to take two different data that is EmployeeName from Employee Table and ClientName from Client Table.How i can write it in a single SQL Query.
Try using JOIN.
You can find about Joins here[^]
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Or you can also use UNION operator to combine data from 2 select statements....
<< >>
|
|
|
|
|
|
Try to use the Response.write to write out the Statement
Then u can use SQL analysis to test it
or try this
=db.OpenRecordset("select * from emp where empno='" & Val(Text1(0).Text) & "' and ename='" & Val(Text1(1).Text) & "' and hidate='" & Text1(5).Text) &"'"
|
|
|
|
|
Hi,
In SQL Statement:
EX:
============
SELECT * FROM table_name WHERE field1 BETWEEN 1 AND 10
============
PLEASE CHECK YOUR STATEMENT AGAIN.
Hy Chanhan
|
|
|
|
|
hi,
pleas give space between "empno" and "and" statement
Ravikumar
[Coimbatore]
|
|
|
|
|
capamaro wrote: ("'select * from emp where empno='" & Val(Text1(0).Text) & "'[insert space] and ename='" & Val(Text1(1).Text) & "'[insert space]and hidate=[#]" & Text1(5).Text & "[#];")
You have an extra single quote in that query and are missing some spacing. When in doubt do a Debug.Print SQLQuery to see how it looks to the database engine.
You should really take a look at the article below, it’s not in the same language, but the content is still worth reading. Protecting the database is your number one goal no matter who the end users are. The way your queries are run they are prime for SQL injection attacks.
SQL Injection Attacks and Some Tips on How to Prevent Them[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
It is vulnerable to SQL injection.
(Also try wrapping the date in ##
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi,
I want to join 2 xml documents to get the result into one table. Can any one gives the syntax.
Regards,
Kalyan
|
|
|
|
|
I want to update a cell in a datagrid, and then update my database with the cellvalue - Hopefully, using a contextmenu.
I am using a data/adapter.fill for the grid
Gord Warwick
|
|
|
|
|
Isn't updating the cell in grid update the database automatically?
|
|
|
|
|
No...I would like some code examples, please
|
|
|
|
|
try this web site:
<a href="http://samples.gotdotnet.com/quickstart/aspplus/" rel="nofollow">http://samples.gotdotnet.com/quickstart/aspplus/</a>
|
|
|
|
|
Thanks...I am a Virgin (Novice) .NET developer
This is not an ASP.NET project...it is a WINDOWS app
|
|
|
|
|
Hi
What is the activex control name for PivotTable and SpreadSheet and Chart?
I want to use them in a "Windows Form Application".
|
|
|
|
|
I use C# to Insert values into tables.
Now, I have a table that has a automatic counter as the ID.
Is there away that after I make insert I will get the ID of the row ? or do I have to make another pass using select ?
|
|
|
|
|
clint1982 wrote: Is there away that after I make insert I will get the ID of the row ?
INSERT ....
SELECT SCOPE_IDENTITY() AS Id
|
|
|
|
|
Hi
I want to insert into a table information and if the value exists it shouldn't insert but also not throw an error message.
Is there any option to the insert statement ?
It is in SQL Server.
Thanks,
Clint
|
|
|
|
|
BEGIN TRANSACTION
IF NOT EXISTS (SELECT * FROM SomeTable WHERE SomeColumn = @SomeValue)
BEGIN
INSERT ....
END
END TRANSACTION
|
|
|
|
|
Is there anyway to avoid two passes over the table ?
|
|
|
|
|
Yes, but you'll have to catch the exception. The overhead for the exception is probably greater than the overhead for passing over the table twice in a single operation.
|
|
|
|
|
Are you doing from Sql Server itself orfrom a client application? If it's the case wich is the programming language you are using?
Marc.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I have a sql statement were I am trying to do string comparison by passing a value.
SELECT CustName, CustAdd, CustCity, CustState, CustZip
FROM CustomerList
WHERE CustType = 1 OR CustType = 6 AND CustName >= @BNAME AND CustName <= @ENAME ORDER BY CustName
When the value passed is "z" and "z" it returns much more than that. Why is that so? Is it because the name is longer than "z"? How could I write this statement to work like I want it?
Thanx in advance
Jude
|
|
|
|
|
I'm not entirely sure what you want, is it something like this:
For table:
Alice
Bob
Charlie
Dave
Pass in 'B' and 'D', do you want to get everybody but Alice?
|
|
|
|