I can use some help with a sql INSERT.
words_table contains
productid
word
product table contains
productid
description
I'd like to create a row in words_table that contains the productid and the word "foundit"
for each row in product table WHERE description LIKE '%keyword%'.
and I'm not sure how to do it.
Thanks
...
If I have a simple database table of names like so:
--------------
| NAME |
--------------
| Andrew |
| Bill |
| Andrew |
| Claire |
| Claire |
| Andrew |
--------------
Is it possible to run a query that would produce a tally of the names? i.e.
-----------------------
| NAME | COUNT |
--------...
I've run into quite a tough problem for my novice SQL query writing skills. I'll try and describe my problem as best I can.
Table1:
Account, Date, Time, Area, ResultValue, ResultString, Phone, GUID
Table2: Name, Account, phone, GUID
For each record in Table2 I need the the single record from Table1 that is most accurate to the follow...
Here's the Schema in mysql:
CREATE TABLE IF NOT EXISTS `labs_test`.`games` (
`game_id` INT NOT NULL AUTO_INCREMENT ,
`key` VARCHAR(45) NOT NULL ,
`config` BLOB NOT NULL ,
`game_version` BIGINT NOT NULL DEFAULT 1 ,
PRIMARY KEY (`game_id`) ,
INDEX `key` (`key`(8) ASC) ,
INDEX `version` (`game_version` ASC) )
ENGINE = InnoD...
Hi!
How do I get id of an insert query? Simple:
insert into Ex(sth) values("value");
select @@identity
does not work. When I try to ExecuteScalar or any other I get exception: {"There was an error parsing the query. [ Token line number = 3,Token line offset = 95,Token in error = select ]"}.
I remind this is the CE edition. I'm using...
i'm using elixir as my orm for mysql database,
and it's hard for me to write a update sql under elixir
"update products set price=NULL where id>100"
class Product(Entity):
using_options(tablename='model_product')
name = Field(Unicode(200))
en_name = Field(Unicode(200))
price ...
Hi,
In a stored procedure in SQL Server 2008, I need to parse strings like "12M" and return 12 * 30 days as an int. So, I am basically parsing and calculating the number of days the string represents.
I am not sure how this can be done.
I am thinking to do a while loop over each character in the string. Any suggestion?
Edit (not aut...
I have color column in MySQL table which type is ENUM('RED', 'YELLOW', 'MY_COLOR', 'BLACK'), and another name column which type is VARCHAR(30).
I would like to get all table rows in the following order:
YELLOW rows first, sorted by name
RED rows last, sorted by name
In the middle, all other rows, sorted by name
Is that possible to m...
I've been using sqlite3 in a python application, and when testing it, my queries sometimes cause the program to freeze up. A rough (from memory) example:
SELECT id,name FROM main_table WHERE name IN
(SELECT name FROM another_table WHERE another_table.attribute IN
('foo', 'bar', 'baz'))
Often, the first time I attempt something like...
My application let users to send files to each other. Regular users can edit their contacts, change password, etc. In addition, admin users can add/remove users and view the log of what happened. My question is how to store this log in MySQL database ?
I thought to store the log like this:
log_id time user_id action_type ...
I have got a table named student. I have written this query:
select * From student where sname in ('rajesh','rohit','rajesh')
In the above query it's returning me two records; one matching 'rajesh' and another matching: 'rohit'.
But i want there to be 3 records: 2 for 'rajesh' and 1 for 'rohit'.
Please provide me some solution or t...
Hello Experts,
Can someone please advise me on the below.
I have 2 databases, both of then were identical until few years back when we started to add more tables, procedures, views triggers etc to one of the database. Now i have to copy all the changes made in database 1 to database 2.
Please, can someone throw some pointers or links...
Dear Team,
My company is planning to migrate it's intranet/internet based ERP to the latest form of MS SQL Database available.
Presently we are using SQL Server 2000 Professional.
And we are planning to shift to SQL Server 2008 Web edition.
Please tell me whether this is the right step and whether it is feasible or not.
Thank you in ...
I wanna connect to aspnetdb but it makes an error says "Login failed for user"
this is the connection string in web config :
<add name="UserProfiles" connectionString="Data Source=KIA;Initial Catalog=aspnetdb;Integrated Security=True;"
providerName="System.Data.SqlClient" />
and this is my code:
SqlConnection connection = new SqlC...
I have a table of banners. Banners are marked with size id and slot id(position on page)
I need to pick 8 banners of one size, 1 for each slot between 11-18(slot id) and keep randomness each page view, so that each time banners were different if there any different for required slot.
The only solution i have found is this:
SELECT *
FR...
Hi all, I have an ASP.NET page which contains a large number of gridviews, which contain masses amount of data which take a fair while to rebind. I currently have it set so the gridviews are only bound when the account number is changed (on the page, the user searches for an account which then displays their information).
I'd like it to...
I have 2 questions :
i) How can put this code in a transaction ?
With ObjectContext in EF, I use ExecuteStoreQuery() method to start some stored procedure. I have a block of code like this :
{
foreach(...)
{
objectContext.ExecuteStoreQuery( @"INSERT MyProcedure (arg1, arg2) VALUES ({0}, {1}...
Hello
I want to learn quickly writing Stored Procedure and Trigger?
Can you suggest any link, eBook, etc?
...
How we can select the second largest mark or whatever from a table without using the LIMIT ?
I know it is possible using LIMIT, but is it possible without using that?
suppose we have the columns id and marks.
...
Hy,
I'm new with SQL Compact Edition and I am having problems renaming a column. I know that you can rename a table using sp_rename and this doesn't work with columns.
I've searched for an alternative, but didn't find one.
Can I delete a column and then add a new one after a specific column? If I delete the column and add it after t...