#mysql
27 October 2007
Total 16 pages. You are browsing page 3/16.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
01:35 <****> which automatically does the presentation and sorting for you
01:36 <****> finally!
01:36 <****> spq, but like I said, the fields size is dynamically
01:36 <****> assimilation is futile
01:36 <****> you can a) calculate the maximum length (by scaning throu all data) or b) keep an eye on the maximum length (what about stored procedures? i only know postre sql ^^)
01:36 <****> adaptr, 1.1.1.1 is not a number so I can't use bigint
01:36 <****> but thanks...
01:37 <****> fromvega no. you use 4 columns, each a bigint with a fixed but larger-than-your-maximum representation size
01:37 <****> those 4 together are your values
01:37 <****> store the original as a varchar
01:37 <****> if he has a maximum size this is the best method
01:37 <****> data redundancy is not bad if it's useful
01:37 <****> adaptr, dynamically fields would need to change the structure of the table or create such a complex structure that I prefer sorting in the application
01:38 <****> fromveag you're babbling now - you stated that there are 4 fields, period
01:38 <****> so use that knowledge to design a proper table
01:38 <****> adaptr, no, that was an example... I gave 2 examples for spq...
01:38 <****> what? you said all your "numbers" would have exactly four fields
01:39 <****> fromvega if you have accounting software (or even thoughts) that use non-fixed-format data, I don't think I want to work where you do - ever
01:39 <****> spq, no, all will have the same number of fields, but this number can change...
01:39 <****> ok, thought you mean the numbers between the dots which can change
01:39 <****> fromvega what do these values represent ?
01:40 <****> do you have any maximum? ^^
01:40 <****> adaptr, hierarchical representation of accounts
01:40 <****> spq, theorically no
01:40 <****> pratically yes
01:41 <****> fromvega then build that hierarchy into your data structures - that's what they are for
01:41 <****> if you can't do that, forget about SQL for this job
01:42 <****> yes that would be the best and use your practical maximums
01:42 <****> you cant have more accounts than number of humans on earth * max. num of accounts per human ^^
01:42 <****> adaptr, yeah, I know I can change it, but the way I'm doing is already one of the "classical" solutions and that would imply data reformating... just wondering about sorting
01:43 <****> spq, huahuahua but they are not banking accounts, it could be one account for each star huahuahuhua
01:43 <****> fromvega accountants are notoriously lousy at data structuring
01:43 <****> that's why we have DBAs
01:44 <****> adaptr, I'm not an accountants, just trying to build a software for an acoountant hehehe
01:44 <****> then you're lousy at it as well :)
01:44 <****> yeah
01:44 <****> maybe
01:45 <****> seriously... pastebin your CREATE TABLE statement, or is it one of those the-logic-is-in-the-database jobbies ?
01:46 <****> adaptr, the-logic-is-in-the-database job
01:46 <****> you do know that that is the road to hell, yes ?
01:47 <****> hehehe yeah...
01:56 <****> hello all anyone know about freeradius/mysql
01:56 <****> or am i in the wrong channel
01:57 <****> bye! tks
02:06 <****> hi
02:06 <****> given a query like this:
02:06 <****> select item_name, item_description, item_url, image_primary_key, tbl_items.date_added, tbl_item_categories.name from tbl_items left join tbl_item_categories on tbl_items.category_primary_key = tbl_item_categories.primary_key where tbl_items.user_primary_key = 3;
02:07 <****> how do i relabel field tbl_item_categories.name tbl_item_categories.category_name?
02:09 <****> AS
02:09 <****> if by "relabel" you mean "return from the query and display as", then use AS
02:10 <****> ah, i see.
02:10 <****> yes, that's what i was looking for, thanks.
02:10 <****> tbl_item_categories.name AS category_name
02:10 <****> got it.
02:11 <****> you can label it anything you like, it's flexible
02:11 <****> SELECT COUNT(*) AS [Teh Numbah], SUM(*) AS [Teh Totalz] FROM blah
02:13 <****> i'm passing in random 64 character alnum strings that i'll be using for the names.
02:18 <****> How would you select the value in a column that appears the most times?
02:19 <****> hmm
02:19 <****> order by foo limit 1 ?
02:19 <****> im sure there is a better way.
02:24 <****> does anybody know why I cant get any results when running this from php insted of commandline in mysql?: SELECT id, aika from hakutaulu where not aika='12:00' and id=-2 order by aika;
02:28 <****> you get results from the command line but not in php?
02:28 <****> Zing: check whether you use the same table and database
02:29 <****> when I run the query directly from commandline in mysql I get the results ok, but when I use php to send the query and fetch the result, nothing appears
02:29 <****> when I remove the NOT operator, I get results!
02:29 <****> I just don't understand why?
02:31 <****> seed__: all other queries work, but not this one. The NOT- operator just don't seem to work when run from php
02:31 <****> try != instead NOT x =
02:34 <****> '5' ... != also is fine, but non-standard.
02:38 <****> Zing: What did you expect the NOT to do?
02:38 <****> Xgc: great, NOT (field = '5') declaration went through php and returned the results. also the != worked. THANK you both! Veird that the NOT- operator is not operational when used from php with the same kind of syntax when used from commandline
02:38 <****> Zing: This probably has nothing to do with PHP.
02:39 <****> Zing: Unless you didn't show the real SQL.
02:40 <****> well, the query was that what I wrote (in simple terms) but anyway I thought the same query that went ok from my commandline on the mysql server should've got through from my query sentence in php
03:39 <****> ok real simple question: making my first table, so I typed... create table voter ( lastname varchar, firstname varchar, middlename varchar);
03:40 <****> and I get error 1064 (42000): you have an error in your sql syntax: check the manual that corresponds....
03:40 <****> ' at line 2
03:40 <****> give lenght for varchar
03:40 <****> oh
03:40 <****> I thought becaues is a varchar
03:41 <****> it has no length
03:41 <****> it has
03:41 <****> you have to give it a max length
03:41 <****> text don't have
03:41 <****> varchar and char are almost identical and both requires lenght
03:42 <****> so should I put (255) behind each
03:42 <****> char is just fixed so char(10) will take 10 bytes even if it's empty
03:42 <****> if you think names need 255 chars...
03:42 <****> will it slow down the system
03:42 <****> if I make it more chars
03:43 <****> I need your help!
03:44 <****> !help date
03:44 <****> There is no such command.
03:44 <****> !date
03:44 <****> !man date
03:44 <****> ?
03:44 <****> (Date Calculations) : http://dev.mysql.com/doc/mysql/en/date-calculations.html
03:44 <****> tators: No dates for nerds.
03:44 <****> hrm
Total 16 pages. You are browsing page 3/16.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
