sql

Newline in SQL Server

Can anybody tell me how to save newline in database and also retrieve it in a same manner using asp.net. ...

MySQL Batch increase value?

My client has asked me if I can update about 500 of his prices (increase by 10.00). The products are all stored in a MySQL table, can anyone give me an example SQL query that will do this? Thanks. ...

SQL (Mysql) order problem

Hi all, I have the following query: SELECT a.field_eventid_key_value, a.field_showdate_value, b.nid , c.nid AS CNID FROM content_type_vorfuehrung AS a LEFT JOIN content_type_movies as b ON a.field_eventid_key_value = b.field_eventid_value LEFT JOIN content_type_sonderveranstaltung as c ON a.field_eventid_key_value = c.fi...

odbc32 and SQLBrowseConnect Help

I'm making a call to odbc32.dll (SQLBrowseConnect) to return a list of databases on a sql server. From running a trace I can see the query being executed is select name from master..sysdatabases where has_dbaccess(name)=1 If the credentials I pass aren't the sa user it returns just the system databases. Is there anyway I can use SQL...

Mysql Compare Dates

Hello, I want to compare a date from DB that is between 2 given dates. The column from DB is DATETIME ,and I want to compare it only to date format,not datetime format. SELECT * FROM `players` WHERE CONVERT(CHAR(10),us_reg_date,120) >= '2000-07-05' AND CONVERT(CHAR(10),us_reg_date,120) <= '2011-11-10' I get this error when I execute ...

If Logic in a SQL Statement

What I'm trying to do should be very simple but somehow I can't reach the right answer to my problem. I've asked something similar in the past but the answer given to me previously no longer fits the requirements. So here's what's going on - I need to conditionally select values from a table in my database in a different than the usual m...

EMPTY_CLOB() in Microsoft SQl server

Hey guys, Oracle has a CLOB type and the function EMPTY_CLOB(). I'm looking for an alternative for use in SQL server. Thanks in advance. ...

How show function code from package in ORACLE?

Hi, I have newbie question, what is best way to show function FUNCTION1 from package PACK ? DESC PACK.FUNCTION1 does not work :( Thanks ...

Generating a report in Oracle?

I am trying to generate a report using Oracle but am having some alignment problems. Is there a way to print values in particular columns? I am trying to achieve the following: --------------------------------------------------------- ColA ColB ColC ----- --------- --------- 1 2 1 2 4 ...

django order by date in datetime / extract date from datetime

I have a model with a datetime field and I want to show the most viewed entries for the day today. I thought I might try something like dt_published__date to extract the date from the datetime field but obviously it didn't work. popular = Entry.objects.filter(type='A', is_public=True).order_by('-dt_published__date', '-views', '-dt_writ...

Help writing SQL query..

Possible Duplicate: Need help with a SQL query that combines adjacent rows into a single row So this is how my table looks. ..and I need to write a query to get the output like this: This is not a homework question. ...

SQL - select * from X WHERE (if value is numeric, else ...)

I would need to make a DB select that will behave differently when number or text is entered, just different condition should be used. I think it should be done but not quite sure with the syntax (MSSQL). Thank you I would need: SELECT * FROM X WHERE (IF value passed is numeric = "ID" ELSE "NAME") = Value //ID or Name are columns ...

Does OR clause suppress indexes in oracle?

Does OR clause suppress Indexes, If yes can someone provide appropriate example? ...

SQL Server: should I use information_schema tables over sys tables?

In SQL Server there is two schemas for metadata: INFORMATION_SCHEMA SYS I have heard that INFORMATION_SCHEMA tables are based on ANSI standard. When developing e.g. stored procedures, should it be wise to use INFORMATION_SCHEMA tables over sys tables? ...

Transaction Log SQL Server

All, We often delete many rows from a table and even though we are using set rowcount 10000 most of the times we fill up the Transaction Log. Is there something to do to avoid this problem happening? Thanks, M ...

What a good and free windows SQL client app?

Something like SQL Wave but free or open source? Thanks. ...

SQL Statement using LIKE

I want to know in a column named NUMTSO if there exists data with this format "WO#############", so what I'm doing is this: select * from fx1rah00 where numtso like 'WO[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' but I get nothing. What am I doing wrong? ...

Doctrine Question ?

Hi All , (i) FROM User u LEFT JOIN u.Phonenumbers where u.level > 1 What is u , I assume it is just an ALIAS to User ? (ii) $profile = Doctrine_Query::create() ->from('Profile p') ->innerJoin('p.User u') ->where('p.id = ?', 1) ->fetchOne(); What is p and u here ? Need to quickly learn Doctrine ? Please can anyone help ?...

Parameter Passing (PHP)

I am trying to select a record in a database. I am having a problem with the function runSelect (function is to select a record in the database) I believe it might be with how I am passing my variables in the functions. function select($pUserData){ echo "I am in function select." . "<br/>"; // Create the SQL query ...

SQL query help, conditional join

Hi guys, SQL newbie here :) Here are my tables if anyone's interested. AHH, cant post image yet http://img832.imageshack.us/img832/442/72098588.jpg What I'm trying to do is query the tblPatientStats table within a date interval (@StartDate, @EndDate) and group them accordingly in a data grid on winforms. So each row in tblPatientSta...