I have two variable TO_DATE and FROM_DATE. My table has two fields DOJ and DOL. I want to select all the records whose DOJ < TO_DATE and DOL FROM_DATE.
How can i write an SQL query in for this??
My User object that I want to create and store in the datastore has an email, and a username. How do I make sure when creating my User object that another User object doesn't also have either the same email or the same username?
If I just do a query to see if any other users have already used the username or the email, then there could be a race condition.
Let's say I have the following array (which is the returned value of a database query):
Array ( [0] => PHP [1] => Webdesign [2] => Wordpress [3] => Drupal [4])
And the following string:
Working With Wordpress Shortcodes
How can I compare the array with the string to see if the string contains any word stored in the array? (hopefully that made sense to you :d )
When he finds a match (eg: Wordpress) it should create a hashtag like so:
Working With #Wordpress Shortcodes
I am trying to write a query to select all records from users table where User_DateCreated (datetime field) is = 3 months from today.
Any ideas? Thanks!
A user can have many addresses, but I want to retrieve the latest entry for the user.
In sql I would do:
SELECT TOP 1 *
FROM UserAddress
WHERE userID = @userID
How can I create a criteria query with the same logic?
Is there a TOP functionality?
Hi,
If a website operating on a domain other than my own supports get requests, like:
http://api.someothersite.com/v1/farms
There's no way for me to access it using JSON-P right, they would have to have support for it as a query parameter? Something like:
http://api.someothersite.com/v1/farms?callback=fantastic
I mean, there's no way for me to use it without them explicitly supporting it, right?
Thanks
I have 2 processes: 1 is writing to a sqlite database, 1 is reading from the same database. Occasioally, I get SQLITE_BUSY on my selects. Is this normal? Is their some option or way I could open the database so that it blocks until it CAN complete the query? (I tried the FULLMUTEX option on the open call but it appeared to have no effect).
hello.
I am wondering if there is local version control/snapshots for emacs independent of VC?
let me clarify:
every time I save buffer, I would like to be able to keep track of changes of each save in session. I know I can do something similar with backup files, but they are not automated like VC and a somewhat cumbersome.
I have searched Google, but did not find the solution.
Perhaps my query string was not good.
Thanks
I'm trying to write a little SQL Helper. I have a query like this stored in a string:
DECLARE @V1 INT
--ignore
DECLARE @V11 INT
DECLARE @V12 INT
--endignore
DECLARE @V2 INT
--ignore
SELECT * FROM SampleTable
INNER JOIN AnotherSampleTable
......
--endignore
SELECT * From Employee ORDER BY LastName
My helper method should cut everything what's between
--ignore
and
--endignore
The result string should look like:
DECLARE @V1 INT
DECLARE @V2 INT
SELECT * From Employee ORDER BY LastName
How can achieve my result with RegEx?
I have a table which has a bunch of columns but the two relevant ones are:
Due_Amount MONEY
Bounced_Due_Amount MONEY
I have a SQL query like the following
SELECT * FROM table WHERE (Due_Amount 0 OR Bounced_Due_Amount 0)
Would the best index to put on this table for SQL Server 2008 be an index which includes both columns in the index, or should I put an separate index on each column?
Hi,
I am using group by ID WITH ROLLUP in my mysql query. The thing is I want to store these totals in a variable in php. Is there any way to do that?
Thanks.
I am trying to output a long XML result from SMSS.
When I right click on the results and 'save results as...', I can only get a 2mb file?
I have changed the settings in SMSS via Tools - Options - Query Results - SQL Server - Results to Grid, for XML data to be unlimited.
Forever, it still seems to be truncating my XML results?
So, how can I bypass this problem and output my XML result to a file?
Thanks
I'm passing query string parameter to .aspx page with 'Ñ' character in value.
But Request.QueryString returns some other box '[]' character in return.
I think this request encoding issue. and I do not want to use that HttpUtility.UrlDecode and HttpUtility.UrlEncode methods.
Does anyone know how to solve this?
Hi all,
it may be wrong place to ask this question, but i hope u all programmer must have the interesting naming convention of variables. i have seen many places that some variable names are very good n effective like
common variable names
$link
$db
$connect
$query
$stmt
$sql
$qry
$output
$result
$list
so please suggest me some good names for variable , bcoz all time i have to write
$x, $y etc.. if i want to save something instantly on page...that are even not relevant, so please suggest me good variable names
I would like to display the contents of a DataTable, divided into several groups depending on the value of one of the columns. So, if I have a DataTable (from SQL query) with:
GroupID Name Description
1 foo bar
1 one two
2 some thing
I would like to place all records containing GroupID 1 in one div, all records with GroupID 2 in another div, and so on. How can I do this?
I'm writing in ASP.NET 4.0, with C# codebehind.
Hi guys,
I am here to write a small database application that will be running in desktop (offline mode).
I am using MSAccess 2007 as my database file and trying to write code in vb.net.
I used to write the code vb6 an usually had global variables for storing database connection and executing every query from that.
I am trying to upgrade myself from vb6 to vb.net.
do i need to read some more simple starter books also?
I have the following query
SELECT *
FROM attend
RIGHT OUTER JOIN noattend ON attend.date = noattend.date2
WHERE attend.date
BETWEEN '2010-02-01'
AND '2010-04-01'
AND attend.customerid =1
ORDER BY date DESC
LIMIT 0 , 30
Attend is the table with customerid
noattend is the table with a row for each date (date2) I followed the advice in other questions to right outer join it to create values where there is no record in attend but it still isn't filling in the empties
any help much appreciated
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.
Hi,
I am trying to make a dynamic form which retrives data. How can I use javascript to load a value from a mysql database?
I understand that it must use php in some way, and I know how to query the database and assign the value to a php variable, but I have no idea what to do after that...any advice?
the goal is to have someone enter their orderid say, then the datbase auto pulls down and enters their last invoice in the field below it after they click GO...
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?
When I do an XMLHttpRequest, I always get redirected automatically to the URL (presumably by the headers of the response). For example, if I query "http://www.stackoverflow.com" I will be redirected to "http://stackoverflow.com".
How can I get that final URL? (http://stackoverflow.com/ in the example)
I checked in the response headers but I cannot seem to find it. (I just used the GET/POST method not HEAD).
I am implementing Paging in my application. For this i run a query and get a resultset.
Now i want to get total no of records in this resultset for my paging calculation. How can i get ? i dont want to execute a extra sql which gives me total rows