Is this right sql query???
hello masters
Please chek this statment...
select * from stud_data,old_dont_use where [Sr No]=11 and old_dont_use.[Sr No]=stud_data.[Sr No]
i think it is not valid statment.
there are two tables stud_data and old_dont_use
stud_data is master table and i want data from old.... as per sr no in stud_data
so if it any change in it then please do it
thnk you very muchh in advance
Re: Is this right sql query???
Code:
"SELECT stud_data.*, old_dont_use.* " & _
"FROM stud_data INNER JOIN old_dont_use ON stud_data.[SR No] = old_dont_use.[SR No] " & _
"WHERE stud_data.[SR No] = 11;"
You might find the SQL tutorial in my sig useful :)
Re: Is this right sql query???
Quote:
Originally Posted by MaximilianMayrhofer
Code:
"SELECT stud_data.*, old_dont_use.* " & _
"FROM stud_data INNER JOIN old_dont_use ON stud_data.[SR No] = old_dont_use.[SR No] " & _
"WHERE stud_data.[SR No] = 11;"
You might find the SQL tutorial in my sig useful :)
Beware of SQL injection ;)
Re: Is this right sql query???
Re: Is this right sql query???
In line SQL is open to outside hacking where database names, table names field names, etc can be obtained.
Once obtained, it is not beyond the realm of possibility that malicious actions can be taken against your database.
This is referred to as "Injection"
To avoid possible SQL Injections, you should always use parametized queries or Stored Procedures.
Having said that, however, I would be willing to bet that the overwhelming majority of development done throughout the world still uses in line SQL.
Re: Is this right sql query???
Note this Link
I want to quote one passage:
Quote:
Originally Posted by Wikipedia
It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.
Such as In-Line SQL