![]() |
|
|
|||||||
![]() |
![]() |
![]() |
![]() |
Mark Forums Read |
| Programming :: Programming related discussions :: |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|
#2
|
|
Use the iif() function.
select script.script_id, iif(script.script_id = script_error.script_id, 'YES', 'NO') as ERROR from script, script_error Does the two tables in your select statements needs to be joined? If not the resulting set will be very large. |
||||
|
#3
|
|
MR. COLD FUSION.... ur the man... hahah... lamat kaau bai ha.... peru ask lang ko ha... unsay advantage kung mag join ka?? weak jud kaau ko anang JOIN statements bro.... la pa kaau ko kasabot ana... ang simple join ra jud ako nasabtan ug maau... bsag nag basa nku about anang LEFT JOIN, RIGHT JOIN... d kaau nku pa grasp ang idea.... pwede pa tudlu?? in vernakular?? ahha.. or pwede sad kanang mu gamit ka ug mga words na dali ra masabtan.... hahaha... lamat jud kaau bro.. daku kaau ka ug tabang...
|
|||||
|
#4
|
|
It's difficult to explain.
Joins are used with tables that are normalized. Read first about it here Database normalization - Wikipedia, the free encyclopedia . |
||||
|
#5
|
|
HELP again at sql queries...
unsaon ni nku pag magic sa sql...
|
||||||
|
#7
|
|
bro..
try daw adto na dauga sa imong form.... lets say if ang script_id=00001 dapat unta ang i return sa code mga 1000 ang iyang length.... im just assuming na imo gamit vb.net .... if ever... adto na lang dauga didto sa form.... gamit na lang ka ug mga built in functions.... if ever dili .... pasensya... hehehehehe bitaw... try lang na ang return value nga gikuha nato sa database adto na lang na sa front end |
|||||
|
#8
|
|
ok na mga bro... na magic na nku ang SQL statements... here is my magic.... hhahaha...
select substring(code,1,50) as LimitedCharCode from scripts where script_id = 00001; gamit ra nku ang substring function.... syntax: substring(string, beginning offset, ending offset) NOTE: if you want to start at the beginning, beginning offset should be one (1) kay i think index zero(0) does not exist... tried using zero and there was no output... tried using one and my magic worked.. hahah... |
|||||
|
#9
|
|
lamat sa idea bro.. peru mas nindot jud bro kung daugon nmu sa SQL... kay mas lesser ang code lines na i process... so mas paspas mu compile imo program... so kung ma dala pa gani ug magic sa SQL.. magic-kon jud... peru d gani... go to d last resort... hehehe... |
||||||
|
#12
|
|
Mysql String Manipulations....
got it from the net... Name Description ASCII() Returns numeric value of left-most character BIN() Returns a string representation of the argument BIT_LENGTH() Returns length of argument in bits CHAR_LENGTH() Returns number of characters in argument CHAR() Returns the character for each integer passed CHARACTER_LENGTH() The same as CHAR_LENGTH() CONCAT_WS() Returns concatenate with separator CONCAT() Returns concatenated string CONV() Converts numbers between different number bases ELT() Returns string at index number <=> NULL-safe equal to = Equal EXPORT_SET() Returns a string such that for every bit set in the value bits, you get an on string and for every unset bit, you get an off string FIELD() Returns the index (position) of the first argument in the subsequent arguments FIND_IN_SET() Returns the index position of the first argument within the second argument FORMAT() Returns a number formatted to specified number of decimal places >= Greater than or equal > Greater than HEX() Returns a string representation of a hex value INSERT() Insert a substring at the specified position up to the specified number of characters INSTR() Returns the index of the first occurrence of substring IS NULL NULL value test IS Test a value against a boolean LCASE() The same as LOWER() LEFT() Returns the leftmost number of characters as specified LENGTH() Returns the length of a string in bytes <= Less than or equal < Less than LIKE Simple pattern matching LOAD_FILE() Load the named file LOCATE() Returns the position of the first occurrence of substring LOWER() Returns the argument in lowercase LPAD() Returns the string argument, left-padded with the specified string LTRIM() Removes leading spaces MAKE_SET() Returns a set of comma-separated strings that have the corresponding bit in bits set MID() Returns a substring starting from the specified position !=, <> Not equal NOT LIKE Negation of simple pattern matching NOT REGEXP Negation of REGEXP OCT() Returns a string representation of the octal argument OCTET_LENGTH() The same as LENGTH() ORD() If the leftmost character of the argument is a multi-byte character, returns the code for that character POSITION() The same as LOCATE() QUOTE() Escape the argument for use in an SQL statement REGEXP Pattern matching using regular expressions REPEAT() Repeat a string the specified number of times REPLACE() Replace occurrences of a specified string REVERSE() Reverse the characters in a string RIGHT() Returns the specified rightmost number of characters RLIKE The same as REGEXP RPAD() Append string the specified number of times RTRIM() Removes trailing spaces SOUNDEX() Returns a soundex string (an alphanumeric string representing the phonetic representation of the word. Useful for finding words that sound similar) SOUNDS LIKE() Compares sounds SPACE() Returns a string of the specified number of spaces STRCMP() Compares two strings SUBSTRING_INDEX() Returns a substring from a string before the specified number of occurrences of the delimiter SUBSTRING(), SUBSTR() Returns the substring as specified TRIM() Removes leading and trailing spaces UCASE() The same as UPPER() UNHEX()() Converts each pair of hexadecimal digits to a character UPPER() Converts to uppercase |
|||||