@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5



Comments:

<0> What is the proper way to run an increment/decrement update query?
<0> I have a unique row identified by a combination of keys, and in that row there is a column that keeps track of a sequence and I want to run an update query on that column to say column++ basically
<1> Hey there. Can someone tell me how to center data in a column output display in Oracle? I imagine it's some type of column format command
<2> col columnname justify center
<2> select pay from me where address='jkulm@paypal.com';
<1> I'm getting a big negative number when I try to calculate the sysdate - birthday for age.. any idea why or how to fix it?
<2> switch the numbers...
<0> Jarett could you please tell me the proper way for doing an increment/decrement on a column
<2> sethd, what the heck is an incremental/decremental?
<1> hmm no, I think it's a two-digit date issue
<1> seth, you mean an autonumber?
<2> Fizzter, no if you are converting to date type, it is actually converting it to a number like 234234234234234
<0> I want to run an update query to say a value in a column = that value +1
<0> like say i have a column called numbers and the 3rd row number was "3"
<0> i want to run an update query on that row to say that number = val + 1 .... 3 + 1
<2> sethd, you do that automatically



<0> ?
<2> update tablename set columnfoo = columnfoo +1;
<1> Jarett, someone stored 2 digit years in this thing.. so it thinks 01-01-57 is 2057 :P
<0> so I could do that and add a where clause to identify the specific row by my key
<2> Fizzter, well thats a known property of RRRR date types
<2> sethd, i just told you. if you cant add the where clause to that you shouldnt touch a database
<2> Fizzter, http://www.sql-servers.com/nopaste/?show=166
<0> thanks jarett
<1> i can only use straight sql :P
<2> Fizzter, that is straight sql
<2> if oyu have oracle
<3> anytime you work with dates you wont have non rdbms specific code
<2> its as easy as select months_between( sysdate, dob ) from table
<2> or the minus sign :P
<1> The months_between thing gives me negative numbers though
<1> because it's trying to do 01/23/2006 - 01/01/2057
<1> instead of 1957
<2> well your application is stupid for allowing that
<1> see what I mean?
<1> so how about
<1> months_between(sysdate, dob-(36500)) / 12 AS Age
<3> you need to write your own date convert to make 57 into 1957 then
<2> why dont you just absolute value the output
<3> and work from there
<1> i think what i put works
<1> it subtracts 100 years
<1> haha you can't just abs the output :P
<2> that ***ume all dates are wrong
<2> and they arent
<2> since RRRR is based off a certain day and year
<1> i think the cutoff is janked
<1> because all of them are wrong :P
<4> im running SQL Server 2005 Express and i just had some sort of big crash. the database now shows "In Recovery" and there is a lot of disk actvity going on. can i see the progress of the recovery or what it is doing?
<1> dangit, and that stupid center thing isn't workin' :P
<1> if I ORDER BY on a column, is there any way to select JUST the 4th highest value?
<2> yes there is
<1> can you point me to a reference?
<2> subselect
<2> Fizzter, col table_column format a18 justify center that works..
<1> ok i'll give that a whirl
<1> hang on i'm looking up subselect
<1> is it just a subselect() function or something?
<4> how do i stop a recover in SQL server 2005 and restore a backup?
<1> oh is a subselect just a select statement embedded into another?
<1> i think i see
<1> i've gotten it to return the 2nd highest.. so perhaps I can just embed like 4 of them
<2> dude thats stupid
<2> you ever read intro to oracle tutorials?
<2> rownum
<1> ?
<1> hmm
<1> i guess that'll work :D
<1> eh maybe
<1> it cuts off the rownum before doing the order by
<1> so it isn't sorting properly initially
<1> it sorts AFTER the WHERE rownum clause, so it's just sorting 1 record.. not the one I need
<2> order by in the subselect brainiac
<1> I'm not using a subselect now
<1> i'm just doing SELECT age FROM person WHERE rownum something or rather
<2> wheres your order by?
<1> SELECT age FROM person WHERE rownum=4 ORDER BY age;



<4> is it possible to create a new database from a backup file in SQL server 2005?
<2> peano_, depends if its a valid backup
<1> I had to do a SELECT FROM WHERE IN (SELECT MAX WHERE NOT IN (SELECT MAX)) :P
<2> wow thats inefficient
<1> well i dont know what else to do :(
<4> Jarett_: it should be
<5> is it possible to have a column be both primary and foreign key
<1> yes
<4> Jarett_: i created a new database and tried to restore but it says that its a different database and refuses to restore
<4> the new database has a new name
<1> ARGH!!
<1> The WHERE clause checks the data BEFORE the order by
<1> no matter what method i use
<1> i need to order the data BEFORE limiting the output with WHERE :P
<6> hey guys, on a machine where sql 7 is installed, can i change the hostname of the pc without causing any issue for he sql?
<1> I can't write this query to get the 4th record from the bottom of a sorted query result set :(
<2> ever try order by foo desc in the subselect
<2> and then get the 4rth row of the outer select?
<1> yep
<2> then you messed it up
<1> :P
<5> what is a good book on realational databases
<2> dating for databases
<5> haha
<7> hi
<7> how do i do crossreferencing between tables in mysql, how to i refer to it? what i mean is a field that points to the PRIMARY key of another table, and i want to select some fields of that refered table
<2> DayDreame, no mysql here.. since the core doesnt support foreign keys.. and mysql thinks 31-feb-06 exists... and it ****s
<7> **** so how will we use the calendar? can't be that mysql has that bug
<7> can't you just tell me the comand in general SQL language ?
<2> mysql doesnt natively use or allow foreign keys. only if oyu installed it with innodb. which i doubt you did since you arent smart enough. go ask #mysql
<1> how can I write a check constraint to make sure a column contains a "@" ?
<1> CONSTRAINT email_verify CHECK(email_address LIKE '%@%'); ???
<1> % is for any number of spaces, yes?
<8> hi
<8> I'm curious, if I have a select statement with a WHERE onefield=oneCriteria AND otherField=otherCriteria
<8> the order of selecting records is up to the database engine?
<9> yo
<10> hey
<10> Milkk if you do not explicitly order the rows, ***ume they are random
<11> good evening folks
<11> gnite folks.
<12> hey
<13> Howdy.
<13> Mmm, SQL
<13> Hey quattro.
<14> hi
<14> I"ve got a bunch of queries, and I'm wondering if its possible to change the 'select columns' by a count(*) ?
<14> I want to do this to firstly check how many rows there are
<15> diederick, no idea what you're actually asking
<16> its possible to change an IN by an GROUP BY and WHERE i think
<16> or change an AS by SELECT
<14> dfworking, I want to 'manipulate' the columns or statements after "select" . So lets say I have: select column1, column2, distinct(column3) from .. where .., then I want to change this to: select count(*) from ... where ... to find out how many 'rows' the normal query would return...
<15> which db
<14> mysql
<15> so, you simply want to know how many rows the first query returned?
<14> wel, yes, but without actually using that query because a count(*) is faster than a real select, right?
<15> select count(*) as theCount from table where blah = 1 group by column1,column2,distinct(column3) ?
<14> yes
<15> did you try that?
<14> no
<14> but thats a normal count..
<15> try it and see if it works
<15> try it with and without the group by
<12> anyone using mysql here today?
<17> gr0undh0g: [11:14:49] -NyQuil- 5) No Homework! No MySQL!
<17> It's in the topic too.
<12> trovster, people talk about mysql all the time in here
<18> Hi!
<19> damnit.. i am going to be forced to use mysql :(
<20> heheheheheeh
<21> ****ing BORED
<21> and I'm not feeling too good either
<21> stomach's upset ... bones ache ...
<21> bleh


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #sql
or
Go to some related logs:

#worldcup
#freebsd
#goal
macbook pro dvi to rgb
#gamedev
#slackware
#sql
#politics
#debian
#computers



Home  |  disclaimer  |  contact  |  submit quotes