Forum: MS SQL Jul 26th, 2008 |
| Replies: 2 Views: 1,683 ah sorry, Easter() is my own udf, please replace it by for example yourBirthday.
krs, tesu |
Forum: MS SQL Jul 26th, 2008 |
| Replies: 2 Views: 1,683 hello
SELECT DATEDIFF(DAY, yourBirthday, getdate()) AS silly_days
may work on mssqlserver.
krs,
tesu |
Forum: MS SQL Jul 25th, 2008 |
| Replies: 4 Views: 1,203 Hello,
you may have a look at DATE_FORMAT(date, format), especially specifier %p to convert date and time values.
krs,
tesu |
Forum: MS SQL Jul 25th, 2008 |
| Replies: 3 Views: 3,103 Hello,
php default's is auto commit ON. Therefore, you first step should always be switching it OFF, if you want to do serious database programming. With auto commit ON you will never be able to... |
Forum: MS SQL Jul 25th, 2008 |
| Replies: 3 Views: 1,042 hello,
>>> "select * from table1 where RAM between ... "
Never use *, the sign of slackers! You must always enumerate only those columns you really need for your datagrid!
There are lots of... |
Forum: MS SQL Jul 24th, 2008 |
| Replies: 3 Views: 3,103 hi,
how do you access the database? If by ODBC, you should set autocommit OFF. Unfortunately, ODBC's default is ON!
krs,
tesu |
Forum: MS SQL Jul 22nd, 2008 |
| Replies: 3 Views: 2,218 And also that "unaltered" code went through some modification meanwhile, LOL |
Forum: MS SQL Jul 22nd, 2008 |
| Replies: 3 Views: 2,218 hi,
there are some discrepancies:
1. What are PD.REFNO, PH1.BGROUP, PS1.REFNO ?
2. Is there a self-join: LEFT JOIN TableC LEFT JOIN TableC C ???
3. TableC of first left join... |
Forum: MS SQL Jul 22nd, 2008 |
| Replies: 4 Views: 3,819 hello,
in union clause the column which should be ordered cannot be denoted by column name. Column to be ordered must be specified by its position number like in:
select a, b, c from t1
union... |
Forum: MS SQL Jul 20th, 2008 |
| Replies: 3 Views: 2,230 Hello dmmckelv,
When Edgar Frank Codd invited relational databases his primary idea was to found it on
logic algebra and set theory. The rows of relational tables (aka relations) are sets.... |
Forum: MS SQL Jul 12th, 2008 |
| Replies: 1 Views: 1,750 Hello guptaalok12,
When Edgar Frank Codd invited relational databases his primary idea was to found it on logic algebra and set theory. The Rows of relational tables (aka relations) are sets.... |
Forum: MS SQL Jul 12th, 2008 |
| Replies: 2 Views: 3,079 first do you first update, then:
update whattable set price = 5 where price IS NULL
From now onwards, all goods without price before will now cost 5 yourPriceUnit. Is this really correct?
... |
Forum: MS SQL Jul 11th, 2008 |
| Replies: 5 Views: 1,579 hello,
You want to select some data from three tables. This will be done by two inner joins. If you don't tell which columns of the involved tables should be joined together the result will be... |
Forum: MS SQL Jul 7th, 2008 |
| Replies: 1 Views: 618 Hi qdaddyo
you may try this statement:
with
modi (tn, moda) as
(select ticket_number, min(modified_date) from tictac
where assignee <> 'NONE' group by ticket_number) , |
Forum: MS SQL Jul 6th, 2008 |
| Replies: 4 Views: 943 Hello saisankar_p
Just another solution:
select s.SiteID, SiteName, s.StateID, PostCode, Phone1, StateName,
1 as canDelete
from tbl_site s, tbl_state a, tbl_user_site u, tbl_trial_site t... |
Forum: MS SQL Jul 6th, 2008 |
| Replies: 4 Views: 943 Hello saisankar_p
Because of not having completely read your perfectly written post from begin to end, I presumed canDelete would already be part of one of your tables. I have to apologize to you... |
Forum: MS SQL Jul 4th, 2008 |
| Replies: 4 Views: 943 Hello
If your tables are properly designed simple inner joins will solve your problem:
select * tbl_site join tbl_state join tbl_trial_site join tbl_user_site.
Ok, this result set will... |
Forum: MS SQL Jul 2nd, 2008 |
| Replies: 7 Views: 1,312 Hello
That is true, because the IN list is kind of set, all records will be fetched that contain one of the list's element. So you can say the records are "ored" together in result set.
I... |
Forum: MS SQL Jul 2nd, 2008 |
| Replies: 2 Views: 2,399 [QUOTE=harcaype;639245]
SELECT Vio.ViolationList.ViolationCode,Records.[Violation Commited],Vio.ViolationList.FineAmnt,DriverInfo.[Plate Number]
,DriverInfo.[License Number],DriverInfo.[Reg'd Last... |
Forum: MS SQL Jul 2nd, 2008 |
| Replies: 7 Views: 1,312 hi,
you should consider my posting #3:
You can freely change the IN list
WHERE Mrkt2 IN ('architecture', 'offices', 'hospitality')
for example |
Forum: MS SQL Jul 2nd, 2008 |
| Replies: 5 Views: 4,272 To cut a long story short: there is no way for retrieving a user's password, neither
from SQL-Server login nor from Windows-user login except you have installed keyboard recorder to spying out the... |
Forum: MS SQL Jul 2nd, 2008 |
| Replies: 5 Views: 4,272 where to get them from? what language, environment? need hacker's snippets? |
Forum: MS SQL Jul 1st, 2008 |
| Replies: 7 Views: 1,312 Hi again
I have got this idea of selecting the appropriate data from table Markets:
select distinct PrjID, PrjName from projects
where PrjID IN
(
select PrjID from markets where... |
Forum: MS SQL Jul 1st, 2008 |
| Replies: 7 Views: 1,312 hi
If you were able to redesign table Markets like that:
(PrjID, MarkedID, Market), where at least all three attributes be part of markets' primary key, the query you are looking for and... |
Forum: MS SQL Jul 1st, 2008 |
| Replies: 4 Views: 2,507 amongst other things, it depends on precision... |
Forum: MS SQL Jul 1st, 2008 |
| Replies: 4 Views: 2,507 Hi,
So you have a table consisting of 6 columns: Column Name Data Type Length
Turnover where the latter should be of decimal data type???
What do you mean by "that the max value could be... |
Forum: MS SQL Jun 30th, 2008 |
| Replies: 3 Views: 1,379 Hi again,
well, I have got some problems understanding your screen shots. Wouldn't it be easier you post your sql code for tables and view creations? I know, if select statements are getting more... |
Forum: MS SQL Jun 30th, 2008 |
| Replies: 6 Views: 3,871 In
INSERT INTO dudel2 SELECT name, sex, age FROM dudel GROUP BY name, sex, age;
GROUP BY clause, which must contain all attributes (column names), provides for distinct rows too.
Instead... |
Forum: MS SQL Jun 30th, 2008 |
| Replies: 2 Views: 1,530 Hi,
obviously both is possible as you can read on http://www.microsoft.com/technet/prodtechnol/sql/2005/technologies/dbm_best_pract.mspx
Database mirroring maintains a hot standby database... |
Forum: MS SQL Jun 26th, 2008 |
| Replies: 6 Views: 3,871 Hello michael123
I am afraid, there is no direct way to get rid of duplicate rows.
But you can populate a new table with distinct rows from your given table only, for example:
-- create... |
Forum: MS SQL Jun 26th, 2008 |
| Replies: 1 Views: 836 Hi arupa
Let's look at an example: With create table t(c char(10), v varchar(10)) there will be 10 places, e.g. 10 bytes statically allocated for column c. At first, there will be nothing... |
Forum: MS SQL Jun 25th, 2008 |
| Replies: 2 Views: 3,601 Hi tkotey
Similar problem we have discussed on http://www.daniweb.com/forums/thread127644.html.
you may investigate SQL code from posts #5 and #7 where I gave solutions on how to compute balance... |
Forum: MS SQL Jun 24th, 2008 |
| Replies: 3 Views: 1,379 hi,
this could be a solution:
select SUM (Column A) AS TotalColumnA, SUM (Column B) AS TotalColumnB,
TotalColumnA / TotalColumnB as TotalColumnC from yourTable;
If you want to... |
Forum: MS SQL Jun 24th, 2008 |
| Replies: 2 Views: 3,355 Can you give an examle?
Do you know wildcards % and _ ?
krs,
tesu |
Forum: MS SQL Jun 23rd, 2008 |
| Replies: 1 Views: 818 You can download SQL management studio separately from MS. It's free.
krs,
tesu |
Forum: MS SQL Jun 22nd, 2008 |
| Replies: 3 Views: 2,114 Well, looking at your short code fragments it seems to be hard to me understanding your problem. I would suggest that you post the really complete (from create procedure... till go)
krs,
tesu |
Forum: MS SQL Jun 17th, 2008 |
| Replies: 13 Views: 5,977 Addition
---------
Based on your given instances ERROR, TESTCYCL, LINK and RUN from post #8
select * from error join link join testcyl join run
gives:
5 open 58778 3971 ... |
Forum: MS SQL Jun 17th, 2008 |
| Replies: 13 Views: 5,977 Hi again,
Well, in your FIRST POST you said that the result wouldn't meet your conception
(see: "However, what I really need to...")
Your LAST POST shows the same result as your FIRST POST,... |
Forum: MS SQL Jun 17th, 2008 |
| Replies: 4 Views: 3,236 Hi conwayce,
These SQL selects
select a.column1 from tableA a, tableB b
where a.column1 = b.column1 AND b.column2 = 'apple'
-- or with inner join: |
Forum: MS SQL Jun 17th, 2008 |
| Replies: 4 Views: 3,236 Hi conwayce
Cannot figure out the logic how result is created from the given tables.
How are these two tables related to each other? Are there any (hidden) relationships?
Best you post complete... |