|
Are you using Access? If so check this [^]
|
|
|
|
|
Hi,
Here`s my problem.I have 2 tables Employee and Department as follows
Employee
----------------------------------------------------------------
empid | fname | Lname | Grade | Designation | Dept_id |
----------------------------------------------------------------
Department
---------------------
Dept_id |Dept_name|
---------------------
I want to select empid,fname,lname,grade,designation,Dept_name
I know this is very simple but i am weak in joins.Pls suggest a query such that i can select the values.
|
|
|
|
|
Select empid, fname, LName, Grade, Desination, Dept_name from Employee JOIN department on Department.Dept_id = Employee.Dept_id
(you cqn use LEFT JOIN to get all employees, even those have Dept_Id=null.)
Rédha.
|
|
|
|
|
|
select empid,fname,lname,grade,designation,Dept_name from employee e join department d
on e.dept_id=d.dept_id
Gautham
|
|
|
|
|
Hi,
I merge a dataset into another dataset in my C# application.
While doing the dataset.Merge(myParamDataSet), the event 'position change' is raised from the 'bindingsource'.
Is there a way to stop all bindingsource events before the merge & after the merge?
Best regards,
Jens
|
|
|
|
|
i am new in database handling can any one explain me how to use Crosstab Query in MS Access to show the content of the veriable and not count or sum thanks in advance.
Sasmi
|
|
|
|
|
Hi all...
I m a CPP Developer.
started learning SQL while I was in high school
I know only "SELECT D.A,D.B,E.C FROM D,E WHERE D.id=E.id"
I need to know much more complex stuff and fast...
Does anyone know any good tutorials or books.
thanks alot.
|
|
|
|
|
There are so many available on net. What you need to do is to search them with google.
Best Regards,
Apurva Kaushal
|
|
|
|
|
To learn sql refer msdn that is the best!!
Gautham
|
|
|
|
|
The_Server wrote: Does anyone know any good tutorials or books.
SQL Server Books Online has many examples of how to use each of the available commands and procedures.
|
|
|
|
|
hi,
I prefer http://sqlzoo.net
where one can learn by practising (online)
(explanation, examples and exercise)
|
|
|
|
|
Moving data from file database to sql and questions came up as to whether use of user defined types was best practice or not. What are pros and cons? Do you use them or not and why?
Will also be using these types as parameters from C# code. So welcome any specific comments regarding impact there.
Thanks,
Matt
|
|
|
|
|
I am trying to return only the first 10 records in sql code that has a where clause. here is my current code. Any help is appreciated.
sqlQuery = "SELECT TOP 10 PTXADDR, ZIP, X_COORD, Y_COORD, PARENT FROM JOB.PTXGIS WHERE"
sqlQuery = sqlQuery & " PTXADDR LIKE '" & addr & "%'"
|
|
|
|
|
lavell wrote: I am trying to return only the first 10 records in sql code that has a where clause. here is my current code. Any help is appreciated.
In terms of getting the first 10 rows, I don't see a problem with your code.
In terms of security, you have a great big hole waiting to be exploited. You would be better reading about SQL Injection Attacks and Tips on How to Prevent Them[^]
|
|
|
|
|
sqlQuery = "SELECT TOP 10 PTXADDR, ZIP, X_COORD, Y_COORD, PARENT FROM JOB.PTXGIS WHERE"
sqlQuery += " PTXADDR LIKE '" + addr & "%'"
I just have replaced the '&' to '+'
|
|
|
|
|
It would be better if he didn't inject the value at all. That injection of the address opens a potentially big security hole.
|
|
|
|
|
can't we use the top keyword??
Gautham
|
|
|
|
|
Select top 10 field1 from table1 where field1--Some condition order by field1
Try this
|
|
|
|
|
Hi
using SQL 2000
i created a table (let - TA) and its view (sel * from TA) as VA
after creating the view, i added one column to TA
but the view is not showing it. the view must have to rebuild,
in sysColumns it doesn't shown the new col name in view.
any easy method there have innorder to rebuild it.
Thanks in advance
panal
|
|
|
|
|
panalprasad wrote: any easy method there have innorder to rebuild it.
Use ALTER VIEW to recreate the view.
And, it is considered better practice to actually specify the columns you want to use. Only use SELECT * for quick-to-write ad hoc queries.
|
|
|
|
|
If there is a possibilty that the master table changes frequently go for cursors instead of views...
Gautham
|
|
|
|
|
gauthee wrote: If there is a possibilty that the master table changes frequently go for cursors instead of views...
How would cursors solve the problem?
|
|
|
|
|
hai everybody
Am using sqlserver2000 as my back end. i want to combine 5 tables in a view and then got report from it. Is it possible? Already am combining 2 tables in a view. it was working fine. one table is master it has a composite primary key all the other containing same as a foreign key and also they have thier own primary key(Serial no)
Please Help me
|
|
|
|
|
Then just add the joins to the SELECT statement used to define the view. e.g.
SELECT *
FROM TableA
INNER JOIN TableB ON TableA.Key = TableB.ForeignKey
INNER JOIN TableC ON TableA.Key = TableC.ForeignKey
-- etc...
|
|
|
|