DECLARE @STR_IDS VARCHAR(15)
SET @STR_IDS='7,15,18'
UPDATE TBL_USERS WHERE ID IN @STR_IDS
I know the update statement would not work as the ID is of type INT and i am replacing a varachar value there .How can i change the query so that it will be executed like this in effect ?
UPDATE TBL_USERS WHERE ID IN (7,15,18)
Thanks in advace
When i search for some query and click on any of the results, the link is being redirected to some random sites. What could be the reason behind this? This happens with firefox
Hi,
I'm trying to retrieve a UNIX timestamp from a query by combining a date and a time field in the table, however it keeps returning as zero.
SELECT *,
UNIX_TIMESTAMP(startdate starttime) AS start,
UNIX_TIMESTAMP(enddate endtime) AS end
FROM mytable;
Can anyone help me out?
Thanks.
My Scenario is...
I want to find out whether the table has an identity column or not.Table is unknown to me.I have not done the structure of the table.using Query?
Im using Sql Compact.
I have an app that reads and writes data from sqlite3. I tested it on the simulator it looks like everything is OK. But if the ad-hoc version does a 'delete' or 'insert' query in the sqlite3 file on iPhone, it crashes.
Is it possible to debug ad hoc versions of iPhone apps with XCode?
I have 4 mysql tables and have a single query with JOIN on multiple tables and I am requesting it via jquery ajax, but it takes to much long time from about 1-3 minutes while I want to execute them on average 2-5 seconds.
is there any special way to execute the quries fast
Hi,
I have just started to learn about the pros of foreign keys in database design (mySQL / innoDB) and I wonder if there's any way to temporarily bypass the foreign key when doing a specific delete query, to just delete in the parent table, and not from the linked child tables.
Thanks
consider a tale is as follows,
EmployeeId | Name | Phone_Number
Now, i insert 10 records... When i query them back, select * from myTable they are not selected in the order i inserted. I can obviously keep an autoincrement index and ORDER BY index. But i dont want to alter the table. How can i do this without altering the table?
I have a table with products, their amount and their price. I need to select all entries where the average price per article is between a range.
My query so far:
SELECT productid,AVG(SUM(price)/SUM(amount)) AS avg FROM stock WHERE avg=$from AND avg<=$to GROUP BY productid
If do this, it tells me avg doesnt exist.
Also i obviously need to group by because the sum and average need to be per wine
I have a stored procedure that will return xml. I have delared a variable of type xml and trying to execute the following code
declare @v xml
set @v = execute get_xml @id, 33
whereas id is returned by another query. now it keeps compalinng about the following error
Incorrect syntax near the keyword 'execute'.
I need a query to return this result:
+---------+-----+-------+
| ref_nid | nid | delta |
+---------+-----+-------+
| AA | 97 | 1 |
| BB | 97 | 2 |
| CC | 97 | 3 |
| DD | 98 | 1 |
| EE | 98 | 2 |
| FF | 98 | 3 |
+---------+-----+-------+
However, I do not have the delta column. I need to generate it for each nid group.
In other words, I need an auto incremented number for each group of the result.
my tomcat server is showing error 500 exception. actually i am not able to get connected to the table created in the pg admin3 postgresql database to the project deployed in the server.
can u please tell me the method to modify query in the table created?
Hi, i have a table like this:
Table(MissioneID, Type)
Type can be 1,2 or 3
i have to count missions by type value:
ex. if table's content is:
MissioneID Type
1,1
1,2
1,1
2,3
1,2
The result of query is
MissioneID,Count1,Count2,Count3
1, 2,2,0
2,0,0,1
How can i do?
thanks
hi guys,
I am upgrading from vb6 to vb.net.
I used to list my query results in datagrid in my previous applications. What can be more visually attractive control in replacement of datagrid?
I hate the classic look of datagrid
Hi,
I'm very new to JQuery, but I was told the one of the cool things about it is you can query a mysql database right from an html page(or in my case a smarty template)with out needing php.
I have not found any examples of this so I am asking if someone has one? Thanks
The answer in this post http://stackoverflow.com/questions/2119680/use-jquery-to-check-if-a-url-on-another-domain-is-404-or-not shows how to use YQL in Jquery to check if URL is valid or not. However, I can't get this to work for me. The only difference I can think of is that my URL is a text file (http://mycrossdomain.com/sometext.txt) and not HTML.I think the YQL query needs to be adjusted accordingly. Any help is appreciated.
Hi there,
If I have the report name how can I programmatically get the name of the project/folder the report is in?
So for example if I have a report like so
http://server/Reports/Pages/Report.aspx?ItemPath=/ReportProject1/ReportName
Given "ReportName" how can I figure out that the report is in the folder "ReportProject1"?
So I guess is there a function where I can pass int he report name and get it's details or else query the report server for a list of its report folders and I can loop through these and check some how that the report is inside?
Is it possible to use LIKE in a SQL query to look for patterns of numbers and letters. I need to locate all records where the specific field data has the pattern (2 Numbers,1 hyphen, 3 Letters) ## - AAA I am using SSMS with SQL Server 2008. Any help would be appreciated. THANKS.
how do i write a query that returns aggregate sales data for California in the past x months.
----------------------- -----------------------
| order | | customer |
|-----------------------| |-----------------------|
| orderId int | | customerId int |
| customerId int | | state varchar |
| deposit decimal | -----------------------
| orderDate date |
-----------------------
-----------------------
| orderItem |
|-----------------------|
| orderId int |
| itemId int |
| qty int |
| lineTotal decimal |
| itemPrice decimal |
-----------------------
HI
One of my requirement is to have prefix on all the tables of the django based project (Because db is hosted on shared server). I have used db_table Meta option to set the prefix for the tables which I have created.
Now my query is how do I set the prefix for tables provided by django.contrib.
Instead of auth_group django should create prefix_auth_group.... How do I do that?
Thank you very much...
I want to create an MXML container component that has some of its own chrome -- a standard query display, et al -- and that supports the addition of child components to it. Something a lot like the existing mx:Panel class, which includes a title label, but acts like a plain mx:Box with regards to adding children.
What's the easiest way to do this?
Edit:
To be clear, I want to be able to extend the container using MXML, so the "Multiple visual children" problem is relevant.
The line cmd.ExecuteNonQuery();
cmd.CommandText
CREATE TRIGGER subscription_trig_0 ON subscription
AFTER INSERT AS
UPDATE user_data
SET msg_count = msg_count + 1
FROM user_data
JOIN INSERTED ON user_data.id = INSERTED.recipient;
The exception:
Incorrect syntax near the keyword 'TRIGGER'.
Then using VS 2010, connected to the very same file (a mdf file) i run the query above and i get a success message.
Hello,
I have a table containing last_updated_1 and last_updated_2 columns, used respectively for text and images update time on a post.
I wish I could get a result set of 10 rows based on all time last updated records contained in the 2 columns, ex. row 1 = last_updated_1 record, row 2 = last_updated_2 record, row 3 = last_updated_1 record, etc.
How could I compare inside a MySQL query the both columns values, to get unique & mixed result set ?
Thank you in advance for your help
Say I have a dataframe df with two or more columns, is there an easy way to use unique() or other R function to create a subset of unique combinations of two or more columns?
I know I can use sqldf() and write an easy "SELECT DISTINCT var1, var2, ... varN" query, but I am looking for an R way of doing this.
It occurred to me to try ftable coerced to a dataframe and use the field names, but I also get the cross tabulations of combinations that don't exist in the dataset:
uniques <-
as.data.frame(ftable(df$var1,
df$var2))